The quick way is to do a write erase command when in enable mode. This is an old command, but it is still supported, and works on all the switches and routers. On switches, also delete the vlan.dat file in flash otherwise it still ‘remembers’ the vlans configured.
When you have done the command, reload the router, and it is back to factory default.
If it doesn’t work, then check the config register is set to 0×2102, if not then do the following
DO NOT SAVE AFTER DOING THIS COMMAND !
Then power off, and back on again (after 30 seconds).