Disconnect the battery:
Turn off the engine and open the hood of your Xterra.
Locate the negative battery terminal (usually marked with a minus sign "-" symbol) on the battery.
Using a wrench, loosen and remove the nut or bolt that holds the negative battery cable to the battery terminal.
Be careful not to touch the positive terminal with any metal objects, as this could cause a short circuit.
Wait at least 10 minutes:
Leave the negative battery cable disconnected for at least 10 minutes. This will allow the power capacitors in the vehicle's electronic control units to discharge, clearing the memory that stores the check engine light code.
Reconnect the battery:
After 10 minutes, reconnect the negative battery cable to the battery terminal.
Tighten the nut or bolt that holds the cable in place.
Turn on the ignition:
Without starting the engine, turn the ignition key to the "ON" position.
This will power up the vehicle's electronic systems but won't start the engine.
Check the check engine light:
Observe the check engine light on the dashboard.
If it turns off, the reset process was successful.
If it remains on, there may be a persistent issue that requires diagnosis and repair.
Please note that resetting the check engine light does not fix the underlying problem that caused it to illuminate. If the light comes back on after resetting, it is recommended to have your vehicle diagnosed by a qualified mechanic or automotive technician to identify and address the root cause of the issue.