S.S.
I have a 2 year old boy too. It seems like he goes in phases, sometimes being more whiny and irritable than others. It is so frustrating, isn't it?? I've thought that it is often needs-based: that there is a true reason behind his physical or emotional distress.
When my 2 year old is out of sorts, I've taken to a few different tactics:
1) Snuggle him into coherence. This has really worked for us! He often just needs to re-connect with his mama or dada - so we give him his pacifier [or whatever comforts yours], go into the bedroom, and just lay there together quietly, cuddling him, until he is ready to face the world. This often takes 5 minutes or less and he comes out with a completely different attitude.
2) Outrightly tell him that we don't like to hear his whiny voice and that it bothers our ears: he needs to stop. This works when he is whining only slightly. If he is full-bore, it would make it worse; that is when we go for the snuggling into coherence.
3) When he is being downright rude and aggressive and it isn't need-based (i.e. needing some focused attention), we give him a time-out. I can't believe he responds so well to it, but he does. It seems like it gives him a chance to remove himself from the situation and re-focus. We always hug, talk about it, and cuddle afterwards as well.
Other things you could look into - 1) is he getting enough attention? It seems like my boy gets worse on days where he hasn't gotten enough focused attention, or 2) Food allergies? Perhaps he has a general feeling of unease, either physically or emotionally, caused by an allergic reaction.
Oh, another thing...SNACKS. Sometimes he is hungry, but doesn't know that is why he feels so out of it and goes on to make our life miserable. Offering apples, cheese, raisins, broccoli and/or water is often my very first line of defense.
Those are the big things I've noticed in our situation. Good luck. I know it's tough!