First some good books:
These two will give you some practical suggestions for day-to-day situations:
"How to behave so your Children Will, too!"
and "Positive Discipline"
(Both of those books have versions for preschoolers, too.)
More important though, the book "Raising Cain" will help you to understand what's going in his head, and why it's important to raise boys to be respectful, kind, caring adults without crushing their spirit, or breaking their will.
I have a 4 year old teenager sometimes! Sometimes he's the most mature, respectful, happy-go-lucky kid for weeks or even months on end, and then for no reason I can tell, just kinda goes super cranky. He can turn on a dime! And sometimes he completely loses his temper, but he's starting to realize he just needs to be alone for a few minutes to calm down. And he'll (sometimes) go into another room on his own, thankfully.
The sheer power of a young boy's rage is sometimes astonishing. And if I try to calm him myself (or otherwise stifle him), it usually just gets worse and lasts longer. I used to tell him to punch a pillow when he's mad, but my husband says research has shown that tends to gradually makes things worse, so I've started
It's not a punitive time-out, exactly, as in "Go to your room!" or "Time out" or whatever. Usually I will say something like "I need you to calm down before I can talk to you" or something (doesn't matter much, because he's not listening at that point. Just as long as I don't "lose it" and start yelling) And then I leave the room. If he REALLY wants to argue, he sometimes follows me.
If I *don't* leave the room, he will keep pushing and pushing, until I lose it, get mad at him, and then yell or say something mean to him. It's hard to control my emotions, but I keep thinking "I am the adult. I won't get sucked into his anger. Calm." I figure he's looking to me to model his behavior, and so I NEED to be able to handle my emotions when he's doing his best to push my buttons. (Now if he could read my mind, I'd be in trouble, because as I'm sitting there calmly, with my eyes closed, I may be imagining throwing him out the winda!)
A few nights ago, he lost his temper over something, and he left to go into his own room. I was grateful for the peace, and he seemed to calm down quickly, but he tore 2 pages out of our favorite story book. Five minutes later, he brought it in to show me what he had done. He was so ashamed and kept saying "I'm a bad kid." and put himself in a corner and wouldn't come out. We had a long talk about emotions and how sometimes people do or say something when they are angry and later they feel bad about it, and it's called feeling "ashamed". And it happens to almost everyone, at some time, even grown ups. Then we fixed the book together. I thought it was pretty mature to 'fess up to his mistake. When I was 4, I probably would've been embarrassed and just hidden the book.
Best of luck.