With extended warranties, you're paying someone to take the risk of a costly repair for you. You pay for that "insurance service".
Should you do it? If the insurance cost is low enough, yes.
Example: I have an Electrolux induction cooktop. Just out of warranty, and now only 1 burner of 4 will work at the same time. A net search shows it's common - induction modules that fail due to cheap electronics. The repair cost is ~ $1,100. A new one costs perhaps $1,400. I'd get a new one rather than repair it.
When I replace it, I'll buy a Kenmore (manufactured by Electrolux for Sears) AND the extended warranty Sears offers for $240. We know that 5 of these Electrolux units failed in our 24 unit condo within the first 4 years - a 21% failure rate. This gives me all the info I need to estimate whether the extended warranty is a good deal.
Essentially, buying an extended warranty means ducking an expected $1,400 replacement bill with a 21% probability of failure. The "expected saving" is 21% of $1400, which comes to $291.00. The cost is only $240. Therefore, it's a good deal. It is one of the few extended warranties I've ever bought, and I'm probably tens of thousands of dollars "ahead" because I've paid for my own unexpected failures, but saved much, much more by not buying these warranties.
Remember - extended warranty companies aim to MAKE A PROFIT. They can only do this if their warranty price is substantially higher than their warranty payouts. Most of us buy enough "stuff" that we can afford to be "self-insuring" - that is, pay our own out-of-warranty repairs rather than paying someone else to take the risk for us.