Because your M2 MacBook Air is freezing and restarting repeatedly, first back up your important files if the Mac remains usable.
Disconnect any non essential USB devices, hubs, drives, and other peripherals while troubleshooting. Apple recommends disconnecting external devices when investigating unexpected restarts. If your Mac restarted because of a problem
Before changing or removing software, note exactly when the problem occurs. Check whether it happens only in Mail or also in other apps, while the Mac is idle, or during startup. Also note whether you see a message such as “Your computer was restarted because of a problem.” Record whether the problems began before or after the macOS 27.0 upgrade and when Ollama was installed.
Check System Settings → General → Storage to see how much free space is available, and check System Settings → General → Software Update for any available macOS update.
If the Mac restarts unexpectedly, check System Settings → Privacy & Security → Analytics & Improvements → Analytics Data for a recent report associated with the restart. If there is a panic or crash report, keep it rather than deleting it, since its contents may help identify the type of failure.
Next, test the Mac in Safe Mode. Shut it down, press and hold the power button until “Loading startup options”appears, select your startup disk, hold Shift, and choose Continue in Safe Mode. Use the Mac for a while and see whether the freezing or restarting continues. Start up your Mac in safe mode
If the problem continues in Safe Mode, run Apple Diagnostics. Shut down the Mac, press and hold the power button until the startup options appear, then press Command-D. Record any reference code or result that it provides. Use Apple Diagnostics to test your Mac
Because the problem appeared around the time Ollama was installed and macOS was upgraded, check whether Ollama is installed, whether it is currently running, and whether it launches automatically. This can establish whether there is a relationship without assuming that Ollama is responsible.
If the Mac is still experiencing the problem after these checks, start macOS Recovery. On your M2 Mac, shut it down, press and hold the power button until the startup options appear, select Options, and choose Continue. Recovery provides access to additional troubleshooting tools such as Disk Utility and macOS reinstallation. How to start up from macOS Recovery
If the Mac becomes too unstable to complete these steps, or Apple Diagnostics reports a hardware-related problem, Apple Support or an Apple Authorized Service Provider can examine the Mac.
Have the computer evaluated by the Professionals who have the Special Hardware Software and Expertise to diagnose the issue and offer possible solutions
Make an Appointment at the Apple Genius Bar or call 1 800 MyApple and have them evaluate the computer
Other location Call Centres
Contact Apple for support and service