This will depend on your individual circumstances and mechanical luck - you might end up paying more for the warranty than you claim back, but the reverse could also be true.
If you do want one, it’s important to shop around to find the right policy for a price that suits you.
Certain terms and conditions will likely need to be met to keep the warranty valid, and there will probably be a few exclusions too, such as keeping within a set mileage limit or using only approved parts and fuel.