If you are afraid you are going to lose your home in a foreclosure, all is not lost. There may be a way to salvage the situation by taking advantage of one of several federal programs implemented by the Obama administration.

One program, Making Home Affordable, offers different strategies to get homeowners back on track or help transition them into more affordable housing without experiencing homelessness. Sometimes simply lowering the payments and getting a better interest rate on the mortgage can be enough of a break to avert foreclosure.

The Home Affordable Modification Program lets homeowners lower their mortgage payment to as little as 31 percent of their monthly gross earnings. For 18 percent of those who did a HAMP modification, their monthly notes dropped $1,000 .

There are also programs like the Home Affordable Refinance Program or the Principal Reduction Alternative. These primarily are for those whose homes are “underwater” on their mortgages.

There are other government programs and resources, but sometimes your finances are so fraught that it truly is best to walk away from your debts with a bankruptcy. Filing for bankruptcy does not necessarily mean that you will lose your home to foreclosure. Even when it is just not feasible to try to retain your property, there are other ways of divesting yourself of your interests in the property without the onus of a foreclosure dogging your credit. A deed-in-lieu of foreclosure or a short sale may be able to be arranged instead.

It’s easy to become overwhelmed by your financial troubles and not understand where to turn. If you are facing foreclosure, seeking out legal solutions to debt problems is wise.

Source: U.S. Department of Housing and Urban Development, “Avoiding Foreclosure,” accessed June 24, 2016