Press and hold the power button on your Mac for 10 seconds. Once your Mac turns off, press the button to turn it back on and see if it boots now.
If it still won’t boot, press and hold the power button until your Mac turns off. Then unplug all accessories from your Mac, including printers, drives, USB hubs, and other nonessential devices. You could have an issue with one or more of those devices or their cables. Then turn your Mac back on and see if the issue is fixed.
If your Mac still won’t boot, once again press and hold the power button until your Mac turns off. Then use Disk Utility to repair your startup disk.
If Disk Utility found no errors, reinstall macOS.
If Disk Utility found errors and repaired them, restart your Mac. If the issue returns after restarting, reinstall macOS.
If none of these steps fix your Mac, then it’s time to take your Mac into an Apple store to let a professional troubleshoot your Mac.