You know, in New York, if you build a house there is a state imposed thing called a Home Builder's Warranty. Essentially what it does is protects the consumer from any defects in materials and/or workmanship for up to six years after the home is built. The buyer does not pay extra for it... it's a state imposed warranty.
But, if you are buying a re-sale, what can be done? Many firms, such as mine... RealtyUSA.... offer a home warranty program. The arrangement varies from firm to firm. It might be automatically offered on every home listed by some firms. It might be "available" for a fee to a seller to entice buyers to consider their home over anothers. Often the buyer's are offered the policy once their offer is accepted. Some sellers might even offer to buy the policy for the buyers if it will help a skittish buyer to make a decision.
Another variance is, of course what is covered. Many warranty programs will not cover such items as pool equipment, etc. Some may require an inspection, some may just require filling out an application.
The great thing about these policies is that a buyer can feel comfortable about having help with any unforeseen expenses in the first year of ownership. A seller can leave the closing knowing that if something does happen, it will be attended to. It's not uncommon that a buyer's agent offers to buy the policy as a house warming gift or a showing of their appreciation. AND, often the homeowner may be able to renew the policy indefinitely!
So... bottom line is... ask the question. Of your agent or the other agent... "Is there a home warranty program?" If there is, get a copy of the application and read it over. Could be a real smart move on your part!