You should never buy insurance for anything you can afford to replace, and you should always buy insurance for those things that you wouldn't be able to cover yourself (healthcare and fire insurance are good examples).
This way, you won't have to pay the insurance premium (moral hazard, adverse selection and overheads go away), and you will save money in the long run, even if stuff breaks from time to time. If you want some more solid numbers, Tim Harford suggests in an excellent Slate piece that by doing this you could save more than 90%* of what you would pay on buying insurance from third parties.
Whenever a retailer offers you an extended warranty, simply transfer that amount of money into a dedicated savings account.
When problems arise, you can simply pay for the repairs (or replacement) out of your warranty fund. And once the fund builds up to a sufficiently healthy size, you can back off on your contributions.
Remember… These warranties are designed to be profitable. Thus, more often than not, you’ll come out ahead by skipping them entirely.
Fivecentnickel has more, HT Argmax.
*More than 90%, because the profit insurers make only reflects their overheads, and does not take into account the additonal efficiency generated by solving the moral hazard and adverse selection problems.