Many people believe it is safer for their cats to be kept only indoors. But, that may not be the case. The article “Should cats stay or stray?” identifies many risks associated with a cat living strictly indoors.
The best answer is a mix of indoor and outdoor time. Make your home environment as stress-free and enriching as possible. And, if possible, give your cat safe access to the outdoors via a catio or harness walks.