Generally a home inspection is performed once an offer has been accepted and a contract has been executed. In the contract, you can give yourself a window of time to perform various inspections. Then, if the inspections discover unsatisfactory issues, you can challenge them. If the Seller refuses to cure those items, you may be able to walk away from the deal and receieve your earnest money back.
There is a lot to consider when drafting an offer, but you do have ways to protect yourself.
Syan Real Estate
Call/Text: (505) 730-8181