Spark plugs are the first thing people replace when a misfire code appears, and a fair share of the time that works. The problem is the rest of the time, when a new set of plugs changes nothing and the light comes straight back.
There is a better order to work in, and it costs nothing but an afternoon.
Read the code properly first
The single most useful thing a misfire code carries is whether it names a cylinder.
P0300 is a random or multiple cylinder misfire. The computer could not tie the misses to one cylinder, which means the cause is almost certainly something all the cylinders share: air, fuel supply, or timing. Replacing one coil will not help.
P0301 through P0308 name a cylinder. The cause is in something that belongs to that cylinder alone, and that is a list of exactly four things: its coil, its plug, its injector, and its compression.
If both are stored, for example P0300 with P0302, the engine has a general misfire that is worst on cylinder 2. Start at cylinder 2 but expect a shared cause behind it.
How the computer knows at all
There is no misfire sensor. The computer watches crankshaft speed through the crankshaft position sensor, which is fast enough to see each individual firing event as a small acceleration. A cylinder that does not fire leaves a gap in that rhythm, and because the computer knows the firing order it can usually work out which cylinder was responsible.
This matters practically, because it means anything that upsets crankshaft speed measurement can look like a misfire. A worn crankshaft reluctor ring or driving on a very rough road can both produce misfire counts that are not really misfires.
The swap test
For a cylinder specific code, this is the fastest honest answer available and it needs no tools beyond what you already have.
Move the ignition coil from the misfiring cylinder to a different cylinder. Clear the codes. Drive it until the light returns.
If the code moves to the cylinder you moved the coil to, the coil is the fault. If it stays where it was, the coil is fine and you have ruled it out for certain rather than by guessing.
Repeat with the spark plug. Then, if you can, with the injector.
Whatever does not move with the part is the compression, and that is when a compression gauge earns its cost. Three of the four possible causes get eliminated before you spend anything.
Read the old plug before you bin it
The plug you take out is the cheapest diagnostic information on the engine, and almost everybody throws it away without looking.
A plug that is light brown and simply worn, with the gap opened up, is a plug at the end of its life. That is the easy outcome.
A plug that is black and sooty has been running rich. That points at fuel delivery or air measurement, not ignition, and a new plug will foul the same way.
A plug that is wet with fuel points at an injector stuck open, or at a cylinder that has not been firing at all so the fuel never burned.
A plug that is oily means oil is getting into the combustion chamber, so valve stem seals or piston rings. New plugs will buy you a few thousand miles and then foul again.
A plug with white or crusty deposits can mean coolant is entering the cylinder, which is a head gasket conversation.
What causes a random misfire
When the code is P0300 alone, stop thinking about individual cylinders.
A vacuum leak leans out several cylinders at once, which is exactly the pattern. Check the fuel trims: high at idle and normal at higher rpm is the leak signature.
Low fuel pressure starves everything together, usually worst under load.
A stretched timing chain changes valve timing on every cylinder at once. If P0016 is stored alongside the misfire, this moves to the top of the list.
When to stop driving
If the check engine light is flashing rather than steady, the misfire is severe enough to be pushing unburnt fuel into the catalytic converter. That will destroy it, and quickly. A flashing light is a stop driving instruction, and continuing turns a coil into a converter.