How did you enable the password for the external drive?
Was it through macOS (if so how), or did you use the manufacturer's proprietary software to lock the external drive?
Unless you have a recovery key or can get the password to work, then the data on that locked drive is gone for good.....after all you don't want anyone to be able to get around the lock do you?
How you can re-use the locked drive depends on what type of lock you enabled. If you encrypted the drive using macOS, then just erase the whole physical drive using the instructions in the Apple article @leroydouglas provided.
If you used the drive manufacturer's proprietary software to enable the hardware encryption of an external SSD, then you will need to use that same software to reset the PSID (found on the bottom label of the SSD) which will reset & clear the SSD destroying all data on it.
These are your only options at this point.
FYI, you should always have frequent and regular backups of your computer and all external media (including the cloud & external drives) which contain important & unique data. macOS includes the Time Machine backup software with every copy of macOS, so backups are easy (just buy a dedicated backup drive). The more important the data, then the more backup copies of that data you should have.