Filing for bankruptcy, in Texas or any other state, can provide temporary relief from foreclosure proceedings. Whether you will ultimately get to keep your home depends on a number of factors, including what type of bankruptcy you file.
Whether you file for bankruptcy under Chapter 7 or Chapter 13, a court order called the automatic stay goes into effect as soon as you file your paperwork. The stay stops all collection actions against you, including foreclosure proceedings. However, creditors can file a motion to "lift" the stay, which allows them to go ahead. The court is likely to grant this type of motion if it looks like you ultimately won't be able to keep your home.
Chapter 13 can be a good choice if you want to keep your home but have fallen behind on your payments. In Chapter 13, you can roll your missed payments into your repayment plan. That way, you can pay them off a little bit at a time over several years, rather than having to come up with the entire arrearage at once. As long as you complete your Chapter 13 plan and stay current on your monthly payments going forward, you can keep your home.
In Chapter 7, the trustee can take any property you own that isn't protected by a bankruptcy exemption. As long as you can use the Texas exemptions, however, your home won't be at risk: Texas provides an unlimited homestead exemption that protects all of your equity in your home, as long as it doesn't exceed a certain acreage.
If you are facing foreclosure, your bankruptcy will wipe out your personal liability to repay the debt. However, the lender still has the right to take back the house. So, if you want to keep it, you will have to come up with the money you owe and get current going forward.
Chapter 7 can help postpone foreclosure for at least a few months. Because it discharges many debts, it might also help you free up more money to pay your mortgage. But ultimately, Chapter 7 doesn't give you any way to get back on track with the lender. You'll have to pay back what you owe or negotiate an agreement with the lender if you want to stay in your house.