Chosen Solution

This is happening to me but I don’t have any magnets in the area

Try this methods to fix-

  1. Check your system’s sleep settings Make sure the sleep settings are set the way you want. To view sleep settings, choose Apple menu > System Preferences, then do one of the following: If you’re using a Mac notebook computer: Click Battery , then click Battery or Power Adapter. To set the amount of time that should pass before your computer goes to sleep, drag the “Turn display off after” slider. You can also deselect “Prevent computer from sleeping automatically when the display is off” in the Power Adapter pane. If you’re using a Mac desktop computer: Click Energy Saver . To set the amount of time that should pass before your computer goes to sleep, drag the “Turn display off after” slider.
  2. Check your system’s network access setting Other users may be waking your Mac remotely to use its shared resources. If you don’t want this to happen, choose Apple menu > System Preferences, then do one of the following: If you’re using a Mac notebook computer: Click Battery , click Power Adapter, then deselect “Wake for network access”. If you’re using a Mac desktop computer: Click Energy Saver, then deselect “Wake for network access”.
  3. Check your system’s sharing preferences People using shared services on your Mac can prevent it from sleeping. For example, they may be using a printer connected to your Mac or accessing shared files stored on it. If you don’t want this to happen, you can turn off any services you don’t need to use. Choose Apple menu > System Preferences, then click Sharing . Deselect the On tickbox next to the service you don’t need to use.
  4. Check your system’s activity Processes running in the background can prevent your Mac from sleeping. Check Activity Monitor to see if a process is unexpectedly using your Mac computer’s central processing unit (CPU). Open a Finder window, then go to Applications >Utilities > Activity Monitor. Click the CPU button at the top. Greeting, Rachel Gomez