Yes you need to read through your purchase agreement. Usually the only way you can loose your EMD is to change your mind on purchasing. Usually you have to have a mortgage denial or the inspection revealed something that you didn't like so you gave the seller an addendum which stated the problem inspection & you were withdrawing from the Purchase. The withdrawal has to occur within the inpsection period.
Please contact your Buyers agent for further clarification. Hopefully you have one & not just using the sellers agent.
I wish you the best.
An earnest money deposit can be lost by not fulfilling the terms of a purchase agreement. The terms should be clearly spelled out in the PA. If a buyer attempts to back out after the inspection period or without a mortgage denial letter, the EMD could be at risk. Consult your PA for specific terms and consult w/ your buyer's agent immediately, as time is often a crucial factor. Didn't use a buyer's agent? Consult with the managing broker and/or a real estate attorney ASAP. Good luck!