This was done on a 2900 but applies to all the switches of the same era.
If you have physical access you can power cycle and hold the mode button down for 15 seconds. After that the SYS light will flash on the switch and you will see the following screenshot.
If you don't have physical access (eg. it is a datacenter swich over console only) then power cycle and hit "Ctrl+Pause/Break" repeatedly once the power is on until you see the below.
This shows us all of the files on the flash card, normally the startup file will be "config.text". We will be renaming it temporarily until we boot.
Rename the config.text: rename flash:config.text flash:config.text.orig
You will see output like this
At this point you could just default the switch but we want to reset the password and presumbly look at the existing config and just reset the password for now.
When it asks us if we want the initial configuration dialog? [yes/no]: Answer no
Enter enable mode
Restore our config file:
rename flash:config.text.orig flash:config.text
Set a new password of "realtechtalk.com" (obviously change to the password you want for security reasons).
enable secret realtechtalk.com
Save The New Config/Password You Set
cisco, howto, reset, passwordthis, applies, switches, era, cycle, mode, sys, screenshot, eg, datacenter, swich, console, quot, ctrl, pause, repeatedly, disable, startup, config, flash_init, dir, text, renaming, temporarily, rename, orig, output, default, password, presumbly, existing, initial, configuration, dialog, enable, restore, en, confdig, realtechtalk, wr,