You can't always prevent yourself from being laid off. You can, however, prepare yourself for the possibility.

Losing your job is undoubtedly scary. But being prepared will allow you to focus on finding new employment instead of wasting energy on the stress of paying your bills.

So for starters: It's not always possible, but try to always have savings of at least three months of committed monthly expenses. This should include your mortgage, utilities, tuition, and any other expected bills. Six months is even better than three!

If you have a significant amount of equity in your home, aiming for three months with a home equity line of credit as a fallback is also an option. Don't relying on credit card debt, however. "Credit cards have high interest rates and that creates a vicious cycle of debt," says Josh Stein, a financial adviser with Strategic Wealth Management Group.

Having that emergency savings in place will soften the blow of a layoff and allow you to focus on next steps: like applying for unemployment insurance. The process varies state-by-state, but there will be a period of ineligibility from the time of the application, so the sooner you apply, the better. "In most states," Stein says, "you can apply online. It's pretty simple, and you want to get these benefits started. You'll need some personal information as well as previous employment history." Stein warns that one holdup may be any grey area in your reason for leaving your job, so be prepared if it was not a clearcut situation.

Next up: Evaluate your expenses and eliminate any unnecessary expenditures such as vacations or gym memberships, at least for the time being. The less you have to spend, the less stressed you'll be about making your emergency funds last.

Depending on any severance package, you may need to decide how to continue health-care coverage. The federal law COBRA allows you to continue the same coverage you enjoyed under your previous employer, although the cost can be burdensome now that your employer is no longer contributing. Alternatively, the Affordable Care Act declared a layoff a qualifying event that allows you to shop for coverage on the federal health-care exchange.

Now that your immediate concerns have been addressed, your energy can be focused on finding new employment. Many recruiters find candidates through LinkedIn, so you'll want to update your profile to reflect your best self. Although many worry that being unemployed makes you a less attractive candidate, it's important to be honest, as employment status is easily verifiable information. Consider updating your status to "Looking for employment opportunities." Make sure you have a professional photo on your profile and maintain relevant connections. Using your LinkedIn profile to interact with your network gives potential employers the impression that you are committed to your field.

You should also include an updated resume on your LinkedIn profile. Instead of merely a laundry list of past jobs, use your resume to highlight professional growth. What skills did you take away from your last position? Use action words instead of descriptors. Highlight any promotions within the company. Have a trusted friend review your resume for any grammar or spelling errors. They happen to everyone — but are a glaringly problematic mistake on such an important document.

When you have made a connection with a potential employer, take the time to research the company before any interviews. Many potential employees forgo this important step, and it can make the difference between securing a second interview and never hearing from the company again. Potential employers want to see that you care enough to have done your homework.

In the meantime, while you are working diligently to secure your next job, you'll need to make decisions about any retirement accounts or 401(k) plans with your previous employer. Most people prefer to not leave their money with a company they no longer work for, although that is one option. Another option is to transfer the funds to your new employer. Thirdly, you may choose to roll it over to your own IRA fund, which gives you more control.

Layoffs are always difficult and can feel personal, but they need not be devastating. Taking steps to soften the blow of losing your job will help you recover much more quickly — and with far less impact on your long-term goals.