You may have finally set your sights on one property after scouring the real estate market looking for your dream home. The next thing to do is to secure a deal with the seller and that includes giving your earnest money. However, issues can arise, which may cause either you or the seller to back out of the deal. Can you still get your earnest money back?

Before we begin exploring the options of what you can do to get your earnest money back should things turn sour during a transaction, let us first understand the concept of the term. Investopedia defines earnest money as "a deposit made to a seller showing the buyer's good faith in a transaction."

It also "shows the seller that a buyer is serious about purchasing a property." Given this definition, can the buyer still get his or her money back should their deal turn sour? The answer is yes, but it comes with certain limitations and conditions.

If the seller is the one to back out of your deal because of any reason, then you can get your earnest money back. You may also have to read your contract to see whether the earnest money can be returned to the buyer or if it is nonrefundable.

There are, however, certain times wherein a transaction fails because of a problem on the buyer's side. While problems coming from the buyer's side can often result to the seller taking the earnest money with him or her, Realtor.com notes that there are ways in which you can protect yourself from these instances.

For example, if the lender appraises the house for less than the amount you were expecting, then an appraisal contingency will help ensure that you will get your earnest money back.

If your mortgage application was rejected, a financing contingency will also work to get you a refund. If you are still waiting for the money coming from the sale of your previous house, then it would be wise to have a sale contingency in the contract to ensure that you will get your earnest money back should your house sit in the market for a longer time.