I am wondering how not to be harsh with a toddler. With all the love I have for my boy, I do lose patience and get angry with him once in a while! Any ideas on how to deal with such a situation.
I liked the book "Becoming the parent you want to be" for these types of things. It had an approach that was aiming to adjust for individual parenting style, and had a lot of useful things in particular for parents of toddlers (there are too many books for babies - not enough for toddler stages). Lots of useful things about temper tantrums, demanding behaviour, and generally about how to have actual communication with your kids. It's not everybody's cup of tea, but check out Amazon reviews, and see if you might care for it.
Welcome to parenthood and the $64,000 question. The best thing I ever did in managing that was either taking a 30 second breather outside while my son played in his room (I could see him from the window), or if you have family local, calling them for some backup.
The times I couldn't do either of those, the only thing I could do was repeat in my head: "He's only two, he's only two, he's only two" or whatever your child's age. Keeping that perspective and reminding yourself that they're one giant ball of uncontrolled Id might not make things easier in the moment, but did help relax me enough to handle the situation a lot better than lost patience and anger.
It's a very natural thing to have a shortened temper and get upset. That does not ever imply that you love your child less or anything along those lines. Raising kids is not an easy job.
First, I would like to say, you are not alone. There is a reason they call it the terrible twos and the threes aren't really that much better (I referred to them as the tyrannical threes).
Kids at this age still don't really know how to communicate well - particularly about feelings including hunger, tiredness and frustration. You probably do this already, but just in-case, I'll recommend that to avoid as many outbursts as possible in the first place be prepared. Have snacks at the ready, have sleep options and try to schedule things so your child is getting basic needs met in a regular and scheduled way.
When your child is doing something frustrating, use the proverbial "count to ten rule" while you take a few deep breaths and remind yourself who this kid is and that he is a kid. If you are trying to get something done and your child is "pestering" you. He probably just wants some attention. Can you involve him so you can still get your stuff done, while also offering the attention he needs?
Make sure you are taking care of you. Are you getting enough rest? The right food? Do you get a break from the kids once in awhile? It is hardest to maintain patience when you aren't at your best either.
Realize that sometimes (often) what they did isn't really bad behavior at all but an effort to communicate, OR an effort to help. I once found Alice with a spray bottle full of water, spraying the wooden closet door over and over to the point of forming a puddle below the door (Her dad was in the room, but on the phone and hadn't noticed - I had been in the shower, so it was REALLY wet!). If she hadn't had the chance to say, "look mommy, I wash the door for you" I may never have connected that she thought she was cleaning. Instead of being angry (well, I had a few words for my husband later), I was able to laugh, help her clean it up and explain the difference between how windows and wooden doors are each washed. It very soon became her job to wash the mirrors (at three years, with help and supervision of course).
To help your child develop language to communicate needs faster and more easily, state what you think he wants, feels. . . before laying down the law. For example, "I know you want chocolate milk, but you NEED to eat food first". OR "I know you want to get out of your car seat and run around right now - I do too, but we can't just yet." By telling your child what it is that he or she feels or wants first, you are letting him know you understand and care and second, giving him the language to express himself in a constructive way (when he is ready, he'll start using it too which is less frustrating than the alternative, grunts, pushes, crying and tantrums).
Avoid SOME tantrums and struggles by offering your child's blossoming personality a chance to express itself through choices. Whenever possible, offer up two choices you can be happy with (before frustrating behaviors are occurring). For example, instead of putting out one outfit for your child to wear, put out two. Both outfits should be suitable for the weather and whatever your requirements are for the day (i.e. able to get dirty for play at the park, or formal enough for church) but then allow your child to choose between the two outfits. This actually helps them feel like they have some control over their day which can lead to more flexible children at other times when you can't offer a choice. It also helps them practice decision making.
Lastly, I'd like to refer you to some other related questions on Parenting SE - just in case they are also helpful.
There are more, but this sampling should be good enough to help you find more specifics if you need them. GOOD LUCK!
Role model self-regulatory behavior. Both to help yourself in the situation, and also because watching you do it is how children learn. (look up mirror neurons)
"I'm too frustrated right now, I'm going to go cool down" "I can't listen when you yell, it hurts my hears. Can you ask me nicely?"