It can be a demoralizing experience. You have drained the oil and the oil filter is hanging on like a leech. It won’t come off.
The best way to fix this is not to have it happen in the first place. You can remember to put oil on the gasket and hand tighten the spin on filter just enough to seal it. It might be best to use silicone grease instead of oil on the gasket, but now that doesn’t matter because the dam thing is stuck.
One method is to drive a large screwdriver through the side of the filter and lever it around. This will work, but it leaves a huge mess and often totally destroys the filter leaving only the base attached. Then you stick the screw driver in the small holes around the threaded center hole and with a hammer drive off the base of the filter.
Meanwhile your arms, clothes, the ground are covered with old motor oil.
Here are a few things to try before you resort to the screwdriver method.
Remember that the filter is not stuck on the threads. It is stuck on the compressed gasket between the filter and the block. If you can break that bond the filter will spin free easily. So take a single edge razor blade and work it between the gasket and the block and slide it all the way around the gasket. You might need to use a thin screwdriver instead, but be careful. You don’t want to scar up the machined surface that the oil filter gasket presses against.
There are also many fine tools for wrenching off a spin-on oil filter. One tried and true tool is the band wrench. Some are made with a wide metal band that tightens against the filter’s canister as force is applied. You might have to put some sandpaper in between the band and the filter can to get enough friction. When using band wrenches be sure to have them as close to the base of the filter as you can because there is less risk of crushing the canister there. Another kind of band wrench uses something other than metal, sometimes a sythetic fabric or rubber-like material. These may give you a better grip than the metal band wrenches, but often they are awkward in tight spaces.
Another very effective tool looks like a big pliers with a round jaw. This give a great grip and should also be used at the base of the filter. Its drawback is that there may not be clearance in some engines.
My favorite is the K&N oil filter that has a “nut” on the base of the filter for a 25mm (or 1 inch) wrench. It is a high quality filter that is easy to remove.
When you install a spin on oil filter be sure to lubricate the gasket surface and don’t over tighten. It doesn’t take much to seal the gasket and the pressures are not so great that they will blow the seal (although in cold weather with a high pressure oil pump I’ve seen it happen).
There is always the screwdriver method.
If you read down the long list of comments that people have added over time - look for the one where Tom had a tough time with the screw on filter that was stuck on the engine of his 3000 GT. Here are photos of the mess and the tool he used to get himself out of the mess.