For many people, bankruptcy is the final resort after a severe struggle with debt. It’s not a decision people make lightly. Depending on whether you file for Chapter 7 (liquidation) or Chapter 13 (reorganization) bankruptcy, it can take months or years to complete the process. Your damaged credit score does begin to improve once your debt is erased, or “discharged,” but it may still be hard to borrow money for years after your bankruptcy.

Even so, it may be the best way to get your financial house back in order when faced with unmanageable debt. If you decide on bankruptcy, you’ll need to work with an attorney and complete mandatory credit counseling through government-approved agencies.

We asked Thomas Nitzsche of Clearpoint, a nonprofit credit counseling agency and member of  NerdWallet’s Ask an Advisor network, about what to expect from credit counseling for bankruptcy.

Anyone filing for bankruptcy must receive two certificates: one for pre-filing bankruptcy counseling and one for a pre-discharge education course. The counseling and certificates must be from a consumer credit counseling agency approved by the Executive Office for U.S. Trustees, which oversees bankruptcy cases and is part of the Department of Justice. These rules are according to the Bankruptcy Abuse Prevention and Consumer Protection Act of 2005, which reformed bankruptcy laws.

The idea behind this counseling is to help make sure you know what you’re getting into, what your alternatives may be and the extent of the consequences.

This counseling typically includes a complete review of your financial situation, including current income, household budget and a list of all unsecured debt. Counselors will discuss alternatives to bankruptcy, like debt consolidation, debt management, direct negotiation with your creditors or, in some rare cases, taking no action at all if you’re “judgment-proof.” They’ll also make sure you understand the consequences of bankruptcy: that it will stay on your credit report for up to 10 years, that you may have a hard time getting loans, that you’ll pay higher prices for certain financial products or services, and that you may even have a hard time getting hired by some employers.

The process takes about an hour. The price for this service varies by state and any arrangements the agency may have made with your attorney, but it’s typically $20 to $50. At Clearpoint, an approved agency, clients can earn their pre-filing counseling certificate in an easy online session. Clients enter their relevant information and then have a live chat session with a certified counselor.

After filing for bankruptcy, you also must take a pre-discharge education course. The course lasts two hours and is evaluated by the Justice Department to ensure the topics are in compliance, but agencies aren’t provided with a standard curriculum.

Clearpoint’s course covers personal finance topics in depth, including things like budgeting, financial products and tools, credit scores, contracts and consumer protection laws. It includes interactive tools, including pre- and post-tests, to measure the level of knowledge about these topics, which are important to understand in order to re-establish personal finances, rebuild credit and avoid getting back in debt. Clients also have access to certified counselors via live chat to answer questions. The online course allows filers to meet the necessary requirements to earn their bankruptcy pre-discharge education certificate. The cost is $50 per household.

To get the most out of bankruptcy counseling, make sure you receive services from a reputable agency. Not only must you choose an agency approved by the government, but it’s best to seek a nonprofit agency that is a member of the National Foundation for Credit Counseling and in good standing with the Better Business Bureau. If you wish, you can switch to a different agency for the second counseling session.

Once you’re enrolled, make sure you commit to your counseling. While you can exit and re-enter the online platform as needed, it’s a good idea to set aside a block of time dedicated to these sessions. Couples filing for bankruptcy jointly don’t have to take the sessions together, but everyone who needs a certificate must attend a counseling session and an education course.

Ask the counselors to explain anything you don’t understand. They’ll answer your questions, as long as they’re not legal queries you should ask your attorney.

Thomas Nitzsche is the media relations manager at Clearpoint Credit Counseling Solutions.

The article What to Know About Credit Counseling for Bankruptcy originally appeared on NerdWallet.