My first is only 18 months old, and he gets into everything, and he doesn't listen. I just put him in bed (helps that he's only 18 months and not quite in a real bed yet, hopefully soon) if he doesn't listen three times.
My partner and I have agreed on the "Three times" rule. We're young parents (quite young really), and we're talking about how we were raised, and are taking the best things from that, and adding our own style of parenting. The reason we chose three, was because when we were younger, there was counting to three, then going to our room. Personally, I think that works in certain situations.
If he were to slam the door when he's older, I think I would take away his bedroom door. Nothing to slam that way, and they're simple enough to put back on.
As for not listening, when he is old enough to understand (he isn't yet, he will be soon), we won't listen to him. And if he gets grumpy, we'll talk to him and ask him how he felt when we weren't listening, and then go from there.
Attitude, I don't really understand myself. I mean, children are really testing the waters, and thinking "how far can I push this today" and they are still learning about who they are. To be honest, if my son was just being a little brat in general, just for the sake of it, I would probably ask if something was wrong. Like if they go to kindy are they being bullied, are they copying other kids. And if they say they don't know (it's often how it is with kids, they really just don't know), I'd ask if they wanted to go have a nap or something. I know it might seem a little soft, but I remember getting in trouble for something when I just replied "I don't know"
And doing exactly what he was told not to do? No pudding (Or a favourite thing they get to eat or do). You do what you were told not to do, then you're in big trouble. But that's just me.
I hope I helped a bit, I do only have an 18 month old after all. I know that this worked on my siblings a couple of times, but everyone is different.