RouterOS password can only be reset by reinstalling the router, or using the reset jumper (or jumper hole) in case the hardware is RouterBOARD. For RouterBOARDS just close the jumper and boot the board until the configuration is cleared. For some RouterBOARDs there is not a jumper, but a jumper hole – just put a metal object into the hole, and boot the board.
The below image shows the location of the Reset Jumper on older RouterBOARDs like RB133C:
Note: Don’t forget to remove the jumper after configuration has been reset, or it will be reset every time you reboot.