Make sure that the sales agreement includes a protective clause that makes the final sale contingent on a home inspection. A qualified inspector will uncover any conditions tht might cause you to reconsider the purchase. First of all, select and hire the inspector yourself, rather than let the real estate agent recommend one. Although agents are capable of making honest and well-intentioned referrals, the relationship should be kept at arm's length. In addition, ask for a sample inspection report and if it complies with ASHI standards.
Many companies also belong to statewide home inspection industry associations.
Most important, ask how many years the inspector has been in business. Nothing beats experience in the field. It means the inspector has pleased enough customers to stay in business, and has encountered and dealt with a variety of home types and conditions. Don't just ask for customer references, call the persons listed and ask them very pointed questions. When you make a contract offer, arrange for the inspection and arrange your schedule to attend and see the condition of the home firsthand.