Find a private space where you are sure no one will interrupt. Lock the door if possible. Also, be aware of your surroundings and make sure no one is likely to come in unexpectedly.
If you get caught masturbating to fanfiction, it can lead to extreme embarrassment. People around you may form a negative opinion of you. Socially, it could damage your relationships as it's considered a very private and inappropriate act to be caught doing.
When Emma and Regina get caught, it depends on what they were caught doing. If it was something related to magic use that was prohibited, they could face punishment like being stripped of their powers temporarily or having restrictions placed on them. Also, their personal relationships with other characters could become strained as a result of the catch.
They could get detention. If it's a school - based fanfiction, getting caught doing something naughty or against the rules might land them in detention. They'd have to sit there, probably bored out of their minds, and think about what they did wrong.
It could be a mischievous Pokemon. Maybe a Ditto that has gone a bit wild and accidentally turned into a Pokeball and then somehow 'captured' Ash when he touched it.
One of the best getting caught stories I've heard was when my friend tried to secretly eat a whole cake. His mom came home early from work and caught him with a face full of frosting. It was hilarious because he looked so guilty.
Well, once my friend thought he was being super sneaky smoking weed in his room. But he didn't realize that the smoke alarm was also a carbon monoxide detector. It went off and his whole family came running. His mom was so mad when she smelled the weed. He just stood there with this goofy look on his face, not knowing what to say.
Well, the consequences can vary widely. It depends on the context, like who catches them. If it's a child who catches their parents, it can have a huge impact on the child's mental state and the family dynamic. And from a personal growth perspective, those who get caught may have to face their own sense of morality and make changes in their behavior if they realize they've crossed a line.