The correct way or a way that works?
I've heard several variations but I always just pull the ecu and back-up fuse for a few then pop it back in. Some say you have to do it when it's cold, I've found That to not be true.
You could always just pull the battery cables for a few also. Either way will clear any codes