what @WiddlinDiddlin said is a good approach.
Skelpit lugs were de rigeur in my childhood too but not a parenting style we emulate nowadays thank God.
‘Did you know it’s considered rude/cheeky to say/do whatever’ was our warning. Then if they spoke to us (or more rarely, others) rudely again we did what this post said. ‘You can make your lunch yourself then’ or ‘you can speak nicely or we can go home.’ Got to actually follow through and do it though! Can be embarrassing but it does work.
I agree it’s important to explain (as often as need be, in a measured way at a calm moment) why it is we don’t speak to one another unpleasantly. The consequences etc.
FWIW I’ve got two well-mannered children. The younger has always had a tendency to be cheekier than the elder, but only in private, and mainly now when she’s tired or not getting her own way. I do remember she was particularly defiant at four, I used to get some very interesting nursery reports. However, we worked on it. Now, as soon as I say ‘actually, you do it,’ or ‘the way you’re talking makes me think you’re too tired to go out with your mate later’ or ‘would you speak to your teacher like that?’ she stops it. She’s probably getting slightly lippier again now she’s a tween so there are definitely phases, maybe it’s transitional as they edge towards independence. Testing the boundaries. A bit of verbal rebellion is natural kid-ness of course, they’re not robots, but overall she’s a notably well-mannered lass and it’s been commented on in school/ friends’ houses. She also definitely knows where the line is at home.
I am not a strict parent overall and let a lot go (probably compensating for my own childhood) but I’ve seen a few of DCs friends who were jaw-droppingly cheeky at five still be so cheeky at ten and fifteen it’s tough to watch. Their parents tended to be the sort to ignore as well, so I haven’t any anecdotal proof they just grow out of it alone (unfortunately).