Your deposit is not automatically returned to you. Both parties have to agree as to the disposition of those funds in accordance with the terms of the contract. If you can't come to an agreement with the Seller, or they won't communicate with you...
Start by contacting the Broker that is holding the deposit. Make sure you supply him/her with all of the facts surrounding what happened and why you feel (per the contract) you are entitled to the deposit. Ask if they will intervene on your behalf to see if the Seller will return the deposit.
If they will not agree, the Broker can make a decision to return the deposit to the party they feel is contractually due it. But they don't have to and making that decision can put them in a position of liabilits.
If the Broker, can't or won't make a decision ask for their assistance in contacting the board of Realtors for your county to request a mediation session. They usually cost about $150.
If there is no agreement with any of these steps then your deposit will likely be turned over to the State and you will have to go to court to prove you should get it back.
Anytime there is money on the line you should consult with a licensed attorney to give you guidance that is specific to your contract.
Your situation won't be resolved by simply getting the proper form. As other have suggested, immediately contact your broker. You should also get advice from a real estate attorney sooner rather than later. Contract language is very specific about financing. You need to understand the exact terms that you and the seller agreed-to.
If the seller refuses to release the deposit, and you had an active financing contingency, you should consult an attorney for your next steps. Depending on the contract you used, the seller may be able to retain all/part of your deposit for damages. However, if they have already secured another buyer, their case for damages will be difficult.
You should immediately contact your agent's broker to resolve this issue.