The best thing I can say (and God help me become better at it) is BE CONSISTENT.
Whatever you decide to do, no if, ands, or buts, about it, FOLLOW THROUGH. Do what you say you'll do, and make a proper punishment for whatever was done and be consistent about it.
Also, do not take out your anger on your children: it leads to abuse. Sometimes, if you're really angry about something, you have to take a few minutes to "cool down" so that you can go in without a hot head when you're disciplining.
My father taught me this. He was beaten when he was a boy. He was the second child, and the only boy between five girls, until the next six came along. He ended up having 7 sisters and four brothers. He would get blamed for practically EVERYTHING. He remembers 5 girls sitting on him holding him down while his mother beat the living snot out of him, usually with a belt. And sometimes, he would even get beat again when his father came home.
When he disciplined us (if he ended up having to because my mother would tell him if we did certain things. One of the no-no's was do not backsass your mother. If you did, you got the wrath of dad) he would send us to his room, looking at us straight in the eyes, at our level, and would say, "Go to my room." You wouldn't walk there, you would run, and you would wait there for five minutes. He would show up, and calmly proceed to smack you (sometimes, if the offense was bad enough, on the bare hinder) with a belt (most of the time) THREE TIMES, and no more.
Being enraged when you discipline is not only unhealthy for you, but it's very bad for the children. Don't discipline when you're angry. My father never ever ever beat us, because he remember what it was like when he was beaten, and vowed never to do it.
I still think I have the best dad in the world. Please pray for him. He's 59, and in a wheelchair. This week he got the wheelchair, after several painful years of tolerating walking. He has very bad neuropathy in his legs (meaning, they're basically dead), to the point he can barely stand for a few moments.