When you're looking, keep in mind that things are going to break/wear/deteriorate. It's part of owning a house. What you want to do is make sure there are no major problems lurking about. In the grand scheme of things, things like water heaters are dirt cheap to replace and once replaced they last 10-20 years. A leak pan under the water heater with an appropriate drain pipe is a good thing
Home warranty plans are a good thing! Ask if the seller is willing to purchase one.
As soon as you make an offer and it gets accepted, get in touch with a home inspector immediately. Around here, you have 10 days to get an inspection and most good home inspectors are very booked so you want to start calling right away. The guy I wanted had a 3 week waiting list
Keep in mind that a home inspector will only perform a visual inspection heating and/or central air unit. You'll want to call out the appropriate HVAC inspectors to do a real inspection (they'll check AC line pressure, etc). Don't skip this step like I did. 8 days before closing, the upstairs AC unit failed. Luckily, the sellers had purchased a home warranty plan that took care of it but that would have been an $1800 repair.
While on the subject of heating, ask what kind of heating the house uses. Keep in mind that heat pumps generally don't perform very well in bitterly cold weather.
Take a good look at the windows. Make sure they open. Sounds silly but due to house settling, one of my dining room windows is incredibly difficult to close once open. Had I known this, I would have insisted the sellers fix it. This is a wide 2-part window and will cost a good chunk of cash if I choose to replace it.
Get a copy of the neighborhood covenant, if one exists. Before you make an offer to buy the house, make sure you can live with any restrictions imposed by the neighborhood association. I've seen some asinine restrictions...specific types of window blinds to be used, garage doors must be shut unless you're moving a vehicle in/out...Also, before you make an offer, drive by the house at various times of day. This will let you see if the neighborhood was just abnormally quiet when you toured the house and will also give you a chance to see what your neighbors are like.
Take a good look around the exterior door molding for signs of water damage. My home inspector completely ignored this.
Have a pest inspection performed. Your mortgage company will generally require this anyway. Ask the homeowner about any past pest treatments. If so, call their exterminator, explain that you're buying the house and you want to know exactly what the problem was, whether it was a one-time treatment or is it a recurring problem. Example of a one-time problem: Sometimes a water leak will cause some wood to rot and that'll lead an infestation of black ants. Exterminator kills the ants, carpenter fixes the leak/rot and the problem is solved.
Check the floors for creaks. Some creaking is expected. Lots of creaking might indicate a problem with the flooring. A "mushy" spot on a kitchen floor or bathroom floor is a good indicator of damage due to a previous water leak. One house I toured had such a spot in the kitchen and the realtor kept dodging the question until he finally admitted that there had been a dishwasher leak in the past.