If your cat suddenly becomes inactive, observe whether it is sick. When cats are sick, their digestive function is often affected, which usually manifests as loss of appetite, even refusing to eat or drink, vomiting, diarrhea, etc. So, pay attention to whether your cat has these symptoms and give it easily digestible, nutritious food, especially plenty of water. 
If your cat suddenly becomes inactive and sleeps a lot, it may have caught a cold. Other symptoms may include a runny nose, sneezing, and loss of appetite. It's best to keep your cat warm to prevent the condition from worsening.
When cats are in heat, they may become inactive, lethargic, and even howl incessantly at home. They will usually return to normal once the heat cycle is over.