Most Macs since 2018 have solid state hard drives on their soldered on their logicboard. This website
https://eshop.macsales.com/shop/internal_storage/hard_drives_and_SSD
will tell which ones have a separate drive that an authorized service technician or a skilled computer engineer can replace out of warranty.
That said a drive may be damaged or in disrepair and not appear after you have run internet recovery and can't format it with Disk Utility
Apple offers on board recovery, which is installed when the operating system is initially installed, or reinstalled from scratch using internet recovery, or erase and clone over.
Internet recovery is command-option-shift-R and sometimes just Option-shift-R on 2019 and earlier Macs, where command-R on Intel Macs is for on-board recovery. When you erase the hard drive, onboard recovery command defaults back to internet recovery, and usually the first password it asks for is your WiFi password. If you connect ethernet directly to your modem, your internet recovery will go directly to ethernet, even with a USB-C ethernet adapter or thunderbolt ethernet adapter on Macs that don't have USB-C or ethernet ports. 2020 and later Macs, have these recovery options:
Use macOS Recovery on a Mac with Apple silicon - Apple Support
Using just Option at startup will look for available startup partitions any any attached hard drive or those built-in that support the Mac's hardware and give you the option to boot those OSes.
The fan at startup may indicate it caught in a firmware loop, or has a hardware issue.
If your data isn't backed up, ask a local authorized service center to recommend a data recovery company.
You can also reset the SMC.
Reset the SMC of your Mac - Apple Support
If your data is backed up, see if at least internet recovery works if regular recovery fails. If both fail, bring it to an authorized service provider to figure out what is wrong.