Hi JudithTJ,
Thanks for contacting Apple Support Communities!
We understand that your Mac isn't able to see the internal disk drive in order to install macOS again.
If your Mac starts up to a flashing question mark, it indicates that it can't find a system to start from. If your Macintosh HD isn't listed as a disk to install to, the drive may need to be replaced. You can reset the NVRAM on your Mac to help you to determine if it's able to locate a disk to install to after doing so. Check out this resource which explains what the NVRAM does and how to reset it: Reset NVRAM on your Mac - Apple Support
"If you have an Intel-based Mac
If you're not using a Mac with Apple silicon, you're using an Intel-based Mac.
How to reset NVRAM
- Shut down your Mac.
- Turn on your Mac, then immediately press and hold these four keys together: Option, Command, P, R.
- Release the keys after about 20 seconds, during which your Mac might appear to restart. For example, you might hear a startup sound more than once, or see the Apple logo more than once.
- When your Mac finishes starting up, you might need to adjust any system settings that were reset."
This resource also explains what it means when your Mac starts to a flashing question mark: If your Mac starts up to a question mark - Apple Support
You can also run a diagnostic test on your Mac to check its hardware: Use Apple Diagnostics to test your Mac - Apple Support
If a hardware issue is detected, you may need to replace your Mac as service may not be available for a 2012 model: Obtaining service for your Apple product after an expired warranty - Apple Support
We hope this helps you.
Take care!