If you lose your job and cannot make your mortgage payments right now then you should speak with your bank or the mortgage lender on the house.
Let them know that you've lost your job and are having trouble paying your mortgage right now.
And ask them if it's okay to send at least partial mortgage payments if you can afford to do so and some banks and mortgage lenders will work with you because they want their money on the mortgage and do not like to go through foreclosure which is costly.
Then apply for other jobs until you get hired on a job and then can pay back the mortgage payments owed.
If you cannot pay anymore of the mortgage then sadly you'll be foreclosed on within 3 months to 6 months of missed payments depending on the bank or lender.
But as long as you're making partial payments and actively looking for a job you can usually keep the foreclosure at bay.