Before I comment, your attorney is the ONLY person who can help you with this question. It is also not possible to tell without a copy of your Real Estate Contract. That said, if you wish to terminate the transaction, you should get a copy of the executed contract to your attorney for review. Your attorney is the only one who can determine what position you are in. Your attorney is the only one who can determine if any contingencies or specific performance issues may exist.
Here's a little background on how contracts and contingencies relate to earnest money: Earnest money is typically considered liquidated damages in the case of buyer default. What this means is that if you do not perform your end of the agreement, the earnest money becomes compensation for damages to the seller. This may or may not be the full extent of the damages. The seller has likely spent time and money to prepare for the transaction as stipulated by the contract.
Contracts typically have performance dates. For example, typically a buyer agrees they will pursue acquiring financing diligently by a certain date. If you have been unable to do so, it is typically necessary to notify the seller in writing of the problem or request an extension of the date if more time will resolve the problem. Financing is typically a contingency in many contracts. In other words, if you diligently pursue financing, and are unable to obtain financing, and follow the time and notification duties of the contract, you have performed your end of the bargain, are NOT in default, and earnest money should not be at risk. Other clauses in a contract, such as a cash sale rider, etc, could modify this contingency. You NEED to check with an attorney with an actual executed copy of your contract for their assessment of what has been agreed to and if you are in default. You are in default if you have not performed your agreed end of the contract.
If you are simply getting cold feet, and have not contractual standing to terminate the contract, you have to weigh the potential losses of defaulting against proceeding with the purchase.
Your question needs to be answered by an attorney representing you. Anything else is just guessing.
Best of luck. Go see an attorney as soon as possible. Time may be of the essence.