If you forgot your Mac login password and accidentally “deleted Macintosh HD,” the first step is to clarify exactly what happened before making any further changes.
When you say you “deleted Macintosh HD,” what exactly did you do?
For example, did you use Erase All Content and Settings, select Macintosh HD in Disk Utility and choose Erase, or do something else?
Also, what do you currently see when you start the Mac?
A photo of the screen would be helpful.
If the Mac is still able to start normally, Erase All Content and Settings is Apple's method for returning a supported Mac to the setup experience.
If Macintosh HD was actually erased through Disk Utility, the appropriate procedure may instead involve macOS Recovery and reinstalling macOS.
For now, I would avoid erasing or modifying anything else until we know what was done and what is currently displayed. Once that is clear, the appropriate next step can be identified.
Apple's relevant instructions are Erase All Content and Settings on Mac, Start up from macOS Recovery, and How to reinstall macOS.