To use any of these key combinations, press and hold the keys immediately after pressing the power button to turn on your Mac, or immediately after your Mac begins to restart. Keep holding until the described behavior occurs.
If your Mac is using a firmware password, all of these key combinations are disabled, except as noted below.
Command (⌘)-R: Start up from the built-in macOS Recovery system. Or use Option-Command-R or Shift-Option-Command-R to start up from macOS Recovery over the Internet. macOS Recovery installs different versions of macOS, depending on the key combination you use while starting up. If your Mac is using a firmware password, you're asked to enter the password.
Shift (⇧): Start up in safe mode.
N: Start up from a NetBoot server, if your Mac supports network startup volumes. To use the default boot image on the server, hold down Option-N instead.
T: Start up in target disk mode.
Command-V: Start up in verbose mode.
Eject (⏏) or F12 or mouse button or trackpad button: Eject removable media, such as an optical disc.