Code reader

check engine came on.code read number 4 cyl misfiring.found out number 4 spark plug was loose.replace with new plug.can i reset computer.by just taking battery cable off.

The computer will reset itself after a few driving cycles. Why go through the grief of disconnecting the battery and losing your clock and radio settings, plus the truck will run rough until the computer relearns the engine.
Just let it be, the light will go off after a little while. Turning it off sooner would not prove that you fixed the problem. It would still take the same amount of time for it to come back on if you hadn’t fixed it.