Troubleshooting is a process of elimination and can require some patience.
The first thing I would do is try running Apple Diagnostics to test your hardware.
Run Apple Diagnostics
Follow the steps below to run Apple Diagnostics:
- Fully shut down your Mac
Ensure you have no external hardware (e.g. keyboard, mouse, display, printer, portable hard drive, etc) connected
Restart your Mac
- Immediately press the D key and keep it down until you see the Diagnostics screen appear
- Wait for Diagnostics to finish (this typically only takes a few minutes)
- Once complete, one of two things will appear on the screen:
- a No issues found message
- a brief description of any errors found plus further instructions
- If the diagnostics test does find errors, take a note of what they are
Note: If pressing and holding the D key at Step 3 doesn't work, start again at Step 1 and, at Step 4 press and hold both the OptionD keys instead. This will try and run diagnostics from the internet instead, so you will need to allow more time for it to complete.
Regardless, take a note of what happens and let me know how you went. Then we can proceed with further troubleshooting.