I have a 3 1/2 year old who became VERY whingy after the birth of her sister 6 months ago. We had to try a few techniques before finding what worked for us all.
Firsty, when she whinges, just say, 'mummy doesn't talk to whingy girls, we'll chat when you calm down'. If you stick to this EVERY time, it really will make a difference. Don't buckle, although it's difficult, she'll learn quickly.
We also introduced a reward system. We have a glass jar, which we decorated with stars and glitter, and a bag of plastic coins. When she does something good (eats all her dinner, goes to bed without fuus, behaves on a shopping trip etc) she gets a coin in her jar. When she is naughty, we remove one. When she gets 5 coins, she gets a small treat. When she reaches 50, a small toy and when she gets to 100, she gets a special activity (swimming, skating, zoo etc). I swear this one shocked me by how much it worked, she has been a model child since we started this. Now I only have to threaten to take a coin away and she perks up, and she looks for ways to earn more. She even asks me if she can tidy her room for coins!
Additionally, I started giving her an option. I drop down to her eye level, ask her to look at me, and say simply, 'you can keep misbehaving, or I could take a coin away (or you could put on the naughty step/take away toys etc). this is a recent addition and had helped a lot. It gives her a few seconds to think about why she's whinging.
These things really really helped, and we tried so many other techniques before finding these!