Woohoo, the laptop stayed on long enough for me to create a bootable disk.The easiest way is to use a USB drive.
The other option would be Internet Recovery. Check the info on the link:
Use macOS Recovery on an Intel-based Mac
Learn how to use macOS Recovery on an Intel-based Mac.support.apple.com
For what it's worth, it's running Monterey 12.7.1. What happens is the mouse pointer stops responding, the fans come on, then it shuts down.