If you have lost the password and you want to reset the password of your Cisco ASA router without losing the configuration, below is the process to do so.
Please note: You must be very careful when performing this procedure and have physical access to the router to complete it.
Connect via Putty (COM)
Boot the device
During boot, press CTRL+C

Before proceeding, take note of the current configuration register
Do you wish to change this Configuration Y
Disable System Configuration Y
The rest press Enter (default)

When the prompt is ready, type boot
When the router boots with the default configuration, enter enable (enable password is blank)
Enter copy startup-config running-config
After the configuration is complete, enter the following
Configure Terminal
Password <New_Password>
Enable Password <New_Password>
Username <User> password <New_Password> Privilege 15
config-register <Register code from the start>
Save the configuration by running copy running-config startup-config
Reboot the router, and you should have access to the configuration.

