For password recovery on Catalyst 9300, look at this:
Connect a terminal or PC to the switch.
Set the line speed on the emulation software to 9600 baud.
Power off the standalone switch or the entire switch stack.
Reconnect the power cord to the switch or the active switch. As soon as the System LED blinks, press and release the Mode button 2-3 times. The switch enters the ROMMON mode.
Proceed to the Procedure with Password Recovery Enabled section, and follow the steps.
After recovering the password, reload the switch or the active switch .
On a switch:
On the active switch:
Power on the remaining switches in the stack.