This is a tough one. I was fortunate to have cats that weren’t interested in going out. They enjoyed sitting on the windowsill, watching all the activity, but that’s as far as they would go.
There are some things you can try. When the door is about to be opened, throw a favorite toy in the opposite direction to attract your cat. You can keep a can filled with marbles or pebbles near the door and shake it when the door is open. Cats usually don’t like sudden, loud noises. Or you might keep a spray bottle of water near the door. Anytime the cat approaches the door when it opens, give it a squirt. This might eventually discourage your cat from running out.
If you have any other ideas about preventing your cat from running out the door, I’d be more than happy to hear them.