There is nothing worse than seeing your laptop suddenly shut down and not respond when you press the power button. It is for sure a good reminder that those machines will someday break so backing up your data is a good investment. Luckily, my machine was on the older Apple design which allows unscrewing the SSD, pluging it into an adapter to restore the user's files in case of no backup.
It all started when my Mac shut down on it's own and refused to turn back on. I did the usual "pressing the power button for 10 seconds" with no result. In this article I will go through some steps you can take if you come accross this issue and hopefully something will be useful for you.
SMC or System Management Controller is involved in roles such as keyboard backlighting, the responsiveness of the power button, the responsiveness of the lid as it closes/opens as well as other things related to the fan, battery, etc. So resetting the SMC might help. To do this you need to press SHIFT + CONTROL + OPTION and then the power button. Hold for about 5 seconds then release. You will see the power plug green light turn red then back to green again because the SMC has reset.
The non-volatile memory is a small module that stores settings that need to be accessed quickly. It is not meant to be changed and it relates to configurations such as volume level, display resolution, timezone, etc. To restart the NVRAM, you would press OPTION + CMD + P + R and then the power button.
Something that you should frequently do is clean up your machine from the inside. This requires specific screwdrivers for the MacBook Air: a pentalobe 1.2mm for the external screws and a tork T5 for the battery screws inside.
When you open the back side, you need to disconnect the battery. You then press the power button and hold, then plug the charging cable to the laptop . Sometimes this allows the Mac to start again. You then shut down the laptop and connect the battery back and then try to restart the machine.
You can also check the battery's health condition from the utilities option to look for a battery-related problem.
Another issue I had with my Mac was that it didn't respond to keyboard strokes or the trackpad. One thing that might help in this case is unscrewing the battery so that you can reach the cable behind it that connects the trackpad/keyboard to the motherboard.
You can disconnect this wire and gently clean its tip from both sides. Sometimes you would notice some corrossion or other issues that might cause problems.
After attempting the above-mentioned measures, and after thoroughly examining the motherboard components for any signs of corrossion or decay, I decided that the internal hardware of the machine was clean. My laptop at this point could turn on and the keyboard/trackpad were responsive. However after I loggged in, the laptop then shut down on it's own and restarted itself.
That led me to think that I might have a corrupt software or corrupt SSD. To test the latter, I decided to start the Mac in safe mode where only important applications turn on. In safe mode, my laptop was acting normally and did not restart on its own. So I decided to try to recover the SSD by using the Mac's First Aid utility in Disk Utilities. I ran this on my hard disk and it completed successfully.
The First Aid approach gracefully unmounts then mounts back the volume. After that, I restarted the machine in normal user mode. And that fixed it for me.
The above trials might not work for your machine. In this case, you can do an AHT (Apple Hardware Test) on your laptop by holding the D key on power-on.
Online resources I found useful include: ifixit and appledollars.