Thinking about leaving your spouse and starting over as a divorcee? Make sure you're not leaving money behind, too.

“Divorce is a process that might not be as pleasant or trusting an event as all participants might like, and it’s important to protect your credit and assets throughout the process,” says Andrew Samalin, president of the Association of Divorce Financial Planners.

Related: 7 Costly Money Mistakes and How to Avoid Them

Follow these steps to make sure you don’t lose your shirt in the split.

Know the law where you live. Nine states — Arizona, California, Idaho, Louisiana, Nevada, New Mexico, Texas, Washington and Wisconsin — have community property laws. Generally, whatever either of you earned during your marriage is “marital property” that will be divided equally between you.

Most states, however, have equitable distribution laws. A judge will divide your marital property equitably, but not necessarily equally. Decisions are based on a variety of factors, such as you and your spouse's respective health and employability.

Hire a lawyer. Divorce law is complex and varies from state to state, so hire an attorney. This applies even if you and your spouse still have a good relationship. “The scope of the financial and legal ramifications are too important to not have a professional review it prior to execution,” says Samalin.

Also consult with a financial planner. Choose one who understands how becoming single again can affect your wallet. “A divorce takes one economic unit and turns it into two,” says Samalin. “There are many tax traps that you may be unknowingly subjecting yourself to.”

Re-establish your name. If you have a shared department store credit card, the store might send the credit reporting agencies reports in your husband's name only — which, if you’re a woman, does nothing to establish your credit. Ask the credit bureaus to keep a separate credit history on you, under your name. The Federal Trade Commisson says they don't always have a file on a wife, only on her husband. Plus, if you changed your name when you got married, the agencies might have lost track of you.

Control your debt. Prevent your ex from paying for his new lifestyle with your credit card. Ask banks and other creditors to close, restrict or remove your name — or his name — from any shared credit accounts. And keep an eye on your credit by asking the three major credit bureaus for credit reports.

Note that you may still be responsible for existing debts incurred by either of you during your marriage, even after a divorce, according to the Consumer Financial Protection Bureau.

Related: 5 Smart Ways to Protect Your Credit Score

Update your insurance. Replace life, auto, homeowners and other insurance policies in both your names with new, separate policies, according to the Insurance Information Institute. If you're still on your ex-spouse's policy and she misses a payment, you could lose coverage and not even know it.

On the flip side, if she’s still on your policy, you could be liable for her mistakes. For instance, if she gets into a car accident and gets sued, your policy covers her. But now you're stuck with higher premiums.

Related: 5 Surprising Reasons You Need Renter’s Insurance

Be transparent. It's faster and less expensive if you work together cooperatively to assemble and review your financial documents. If one side gets cagey, forcing them to disclose where they hid the money can be a difficult and expensive legal process.

“There are professionals, such as forensic accountants, that are able to tease out your spouse’s financial circumstances in the event they are less than forthcoming,” says Samalin.

And before you start stashing away cash or running up debt yourself, consult an attorney to see what your state's laws say about that.

Guard your retirement fund. You may be entitled to money in your spouse's pension plan, or vice versa if it's your plan, according to the Internal Revenue Service. The money could be available right away or only after a trigger event, like the plan holder's retirement or death.

To prevent your ex from inheriting your pension after you die, ask the plan's administrator to change the name of the beneficiary, which is probably your spouse.

Related: Money Moves You Must Make Before You Retire

Regardless of your financial circumstances, the best way handle a divorce is honestly and cooperatively, experts say. “The issue boils down to the willingness of the two spouses to work out a reasonable agreement and honor their shared history,” says Samalin.

David Arv Bragi is a freelance journalist and marketing consultant. He has been writing about health and safety issues since the 1990s and currently lives in Portland, Oregon.