Often buyers do not have much of a chance to look at or think about their purchase. Houses sell quickly and often get multiple offers. Sometimes they make offers on a house and then as they have time to think about it get cold feet.
Usually, the house can be put right back on the market and if there were multiple offers the seller can accept another buyers offer. Home sellers can and should keep collecting offers until the sale closes.
I wish buyers wouldn’t back out and the best advice I can offer is if possible buyers should ask for a second showing to see the property again before actually making an offer. Most of the time when the buyer backs out there isn’t anything wrong with the house itself, the problem is with the buyer.
There really isn’t any way that home sellers can prevent a buyer from backing out. Even buyers who offer a lot of earnest money will occasionally back out but usually before their earnest money is at risk.
Sometimes home buyers will ask for a lot of repairs as a way to back out of a purchase. I had some buyers that did that a few years back. Instead of telling me that another home was on the market that they liked better they came up with a lengthy list of repairs and upgrades. When the sellers said no they canceled the purchase and go their earnest money back.