I also second keeping them indoors. I've recently done it for a cat who was abandoned outside and had never lived inside before.
I taught him the phrase, "back back back" to step away from the front door when I need to use it, and it helped a ton! He has never tried to escape, though he does ask to go outside. When he goes outside, I've been teaching him "stay in the yard," and I sit outside with him to make sure he's safe, and make sure all the birds around us are safe too :P
Because he gets confused and panicky at times, I now only let him out when he has a harness on. It took him a while to get used to the harness, and he hasn't yet learned to be excited out going outside when he has his harness on.
When I've allowed my indoor-only cats to come outside for some sunlight, I teach them to stay in eye sight of me. I start by teaching them the specific phrase, "Stay in the yard." The ones who like to explore will walk the exact border of the yard while you follow them, testing out where they're allowed to go.
As in, when the cats go outside, they will walk cautiously to the end of the yard until I saw, "stay in the yard, Name," and then they will pause. At first, you will have to stand right next to them and guide them with your hands, gently. When I was training my cat Beanbag to stay in the yard, if he left the yard a little bit I would tell him, "correct your course," and then put my hands under his tummy to gentle make him walk back to where I wanted him to be. Right when he was back in the yard, I told him, "Good boy!!” He didn't need trests to learn this, though it may have made the ability to understand my communication go faster! Over time, he knew that if I said ”correct your course," it meant get back into the yard.
He's a young man, so he tests my boundaries every day. I stay kind to him, but I do not let him out of my sight. If he does go into the side yard, for example, sometimds I let him negotiate that. That way he has learned that he needs to stay within eye sight of me, and that's more important than anything else.
If he goes near the road, I take him inside immediately. That's a no-go area, no exceptions.
I did not let him negotiate the boundaries when he was learning them, by the way. I didn't want to confuse him. The first thing I did was have strict rules about where he was allowed to go. I kept that up for at least six months. After that, when he asked to go to the side yard, as long as he was where I could see him, he was okay.
Señor Nacho (he was señor gato, but the vet tech on the phone didn't speak Spanish and misheard a funnier name that we decided to keep!) is the cat a neighbor abandoned. He grew up around Spanish, not English or very very little English, and be lived an unusual kittenhood in that he was an outside cat, expected to catch his own meals.
We live in a deciduous rainforest, so that took a toll on the local ecosystem. And his -- I often found him with teeth marks on him from being in some predator's mouth (he has a mild case of celebral palsy, so I'm shocked he even got away!). Moreover, he was used to sitting in the middle of the road to lay down and enjoy the sunshine.
He is also half-feral, though okay with children because the kiddos at the household were excited to interact with him daily.
He was tricky to keep inside, but once I knew for sure he was abandoned (neighbors had to move away, long story short) and the neighbors struggled to try to bring him inside, I got to work with him. I'm still in the process, but it's become smoother.
I start by keeping them inside for six months, and that's where Señor is in his little process right now. This allows the kitty to get used to indoors, and learn how to entertain themselves.
Links other people have provided at this point will be very helpful! My methods may not include all the latest behaviorists' research! There's always more to learn, I feel like :P
But anyway, while indoors I make sure there are areas where each cat can go to have privacy and their own space. This includes at least one litter box per cat, when I'm able, preferably in two different locations (due to spacing issues I don't always have this need met correctly, but I have it as good as I can for now).
For Señor, I have to talk to him in Spanish and experiment with phrases he might already be familiar with. I tell him, in spanish, "I'm sorry, buddy, we have to stay inside! Let's play!" And then I bring him a variety of toys so he can learn which ones he likes. Luckily you can skip the Spanish parts, but the variety of toys will help the kitties learn what they like to do while inside.
Plus, if you play with them, they will quickly learn that it's fun to live inside. And safer! Cats get especially great sleep quality when sleeping indoors, because they don't have to watch their back quite as hard!
For the first 6 months, food is available 24/7, as long as they aren't using food to cope with boredom or adjustment anxiety. This just allows the kitty to adjust their schedule as needed, to be less anxious about being inside suddenly, and to learn that when they're inside, there's plenty of food!
(This will backfire if they don't like the kibble or the kibble is low quality -- those two things activate the kitty's need to hunt. Cats eat herbivores specifically to get certain vitamins and minerals. Make sure they are getting all the vitamins they need. You can add soft hays like oat grass to the diet if they like to chew on grass and you can't provide it 24/7.)
You will be shocked at how easy it becomes to have indoor kitties.
For the first month, Señor and Beanbag, the two in the biggest transitions from outdoor to indoor, became MUCH healthier. No more worms, no more mites! Poops MUCH healthier, too! And without as much insecticide ingestion (cats eat insects and spiders as part of their regular diet, as most are high in protein and fat) and pesticides (because they specifically eat HERBIVORES), their moods have become better overall, because they can actually get all the nutrients they need! They'll suddenly be better hydrated!
(Screw pesticides and insecticides, by the way lol)
The first month is the hardest. The kitties BEG to go out because they're anxious at the change in their environment. It's so difficult to watch and stressful to interact with them. They will often try to be as annoying as they can, meowing like crazy and showing you the door. This is the hardest part because we love our babies so, so much, and it's hard to see them stressed. Especially because we with PTSD tend to project how we'd feel being "stuck" inside.
For me, it helped me to add a catio. We have a window-seat that's basically a small cage that sits outside, like a window A/C unit. I installed a window cat-door behind it and now they have a safe little area to be outside and view the outdoors any time they want.
You can also make your own if you're familiar with making simple structures. (I am not, yet.)
And here's one more tip: if you have the cats outside and you hear a car, act scared. Get down (crouch as much as you can), say phrases like, "oh no! A car! AAA!" and then get far away from the road. As soon as the car is gone, act relieved. Stand up straight, say, "phew!," etc. Cats are observant of their parents, and once inside will assume you are THE parent. This will help teach them that if they do get out, the road is dangerous.
It does not guarantee the cats won't be hit by cars. But it helps a little in that they should start to run out of roads when they hear a car coming towards them.
You also have a potential move going for you if you do this. When you move and then transition cats to a new home, you NEVER want to put them outside day of anyway. It's a recipe for some very hurt cats as they try to challenge other animals for their new territory. But during an entire move, the cats will be forced into "transition mode" anyway, just like us. This is the best time to make them stay inside 24/7 for six months, because they will have to just believe you that indoors is safer in their new environment. Just simply don't let them out during this time.
Your alternative is not to move there. Personally, I would consider my ability to move and provide good housing for my little guys way quicker than I would pause from not being able to let the kitties outside.
If it's possible that the landlord or roommates may be letting them outside without my permission, I would not move, personally.
If animals are dying in the road, and neighbors have not put up signs about looking out for cats or dogs, I would not trust the environment, personally.
I'd consider "hiring" a working dog whose job it was to keep critters away from the road long before I let cats out in an environment like that, to be frank. (And that's a VERY unlikely solution for most of us, lol)
What do you think after reading all that? (If you did, no judgement lol)
Here's Beanbag (the fat orange one) and Señor Nacho (the black one with the silly mustache)! Both getting real used to being indoors and learning to love it :) Señor has learned that his favorite toys include balls! They roll away so he can pounce on them :P They both really love toys that are sticks with feathers or other toys at the end, and cosmic catnip bananas! As well as plastic bags :P