It depends on where you are in the process and what your contractual contingencies are. Your attorney is the best to guide you here.
If you are still in attorney review, you can walk away without any cost to you and get back your good faith deposit (if you put one down.)
If you are out of review and you just cannot meet a contingency, then there is no financial cost to you (unless your contract states otherwise.)
If all contingencies have been met and you are waiting to close, you can be sued for specific performance by the sellers.
If you are thinking of breaking your contract, you need your attorney's advice. As you can see, there are a lot of questions that need to be answered that only you, your attorney and your agent know the answers to.
Breaking a contract to purchase or sell a home is a very serious matter. Consult your attorney for the best guidance.