There are a few things that could be causing your Mac to go to sleep. One possibility is that you are not using your Mac enough, and it is trying to save energy by going to sleep. Another possibility is that there may be something blocking the fan from working properly, which would cause the computer to go into sleep mode to conserve power. If you are consistently experiencing this problem, it may be worth checking to see if there is anything blocking the fan or preventing it from functioning properly.