That's the very basic run down, is subject to the specific terms of whatever your specific contract and addenda say. I'm not attorney and am not trying to give legal advice! You should consult an attorney if you have questions :) How's that for a disclaimer?
Hope that helps!
You would present an offer and negotiate all items; i.e., sales price, survey, option time & fee, etc., with an Addendum to the Contract that states you must have the proceeds from your sale to be able to purchase. You would go ahead with an inspection during the option period to learn about the condition of the property.
The Addendum would state a date by which you would receive your proceeds. If you sell by that date, you would remove the "contingency" and close. If you do not receive your proceeds by the contingency date you might be able to negotiate an extension.
If the Seller negotiates an acceptable offer with a different buyer, they would give you notice and you would have the option of removing your contingency or backing out of the contract. You would receive your Earnest Money back as long as you had complied with all aspects of the contract.
I'd be glad to sit down with you and go over this at your convenience.
When you have a Loan Contingency, you are saying that if your Loan does not come through, you are no longer obligated to buy the house.
When you have an Appraisal Contingency, you are saying that the Appraisal has to be high enough to cover the Bank loan, (the Bank will only loan 80% of the Appraised Value: If the Appraisal isn't high enough, you are not forced to continue with the deal.
When you have an Inspection Contingency, and there are things uncovered, Termites, Repairs, Foundation problems, etc.: In that case you will have three choices; accept the problems and proceed with the purchase, or, negotiate some or all of the repairs, or, walk away.
These would be the 3 most common.
Your Realtor can guide. you.
Good luck and may God bless