How to start time outs

My daughter just turned 3. When she’s upset, she’s starting to get violent. She never did this up until recently. I think we are too lenient on punishment, we don’t really do anything besides talk to her after when she’s calm, bc I felt she was too young. But now I think she’s ready for time outs. How do I start? Do I use a certain area of the house for time outs? I’m also wondering how often you guys give time outs. Do you just do them for the big things? How do you handle time outs when you are in public?

This weekend we were out of town with my parents and my daughter threw the biggest fit in the restaurant bc I wouldn’t give her my phone. She was screaming and trying to slap my face and ripped one of my earrings out. When I was carrying her out of the restaurant she was kicking me. It was bad. My parents were shocked. This is the second time she did this time of thing in public in the last week. This is when I realized we need to start doing more when she does these tantrums. It wasn’t always this bad up until recently!

I just need any sort of advice on where to start with punishments for her age. She is very impatient and

wants everything her way when she wants it. I’m trying to work with her on these things, I honestly didn’t realize how bad this was up until recently when meeting with her new speech teacher. Plus I know it’s gotten worse lately. Her teacher was saying she needs to know the world doesn’t revolve around her. We cater to her too much I know.

Sorry for the rant, I used to feel like a great parent but now I’m feeling like we went wrong somewhere and I’m feeling really bad about it

I will say when we say no to something etc we are very good at being consistent and sticking to that no

Any advice/time out help would be so helpful