I do wonder about this, people talk about whininess in children as though it was inevitable, and I think in the vast majority of cases it's not. Some children do impulsively want to share their displeasure at things being substandard for them, but it needs to be quashed as soon as possible, and never giving in to it.
Our dc was never a whiny sort to begin with to be fair, was diagnosed with language processing disorder so just understanding and speaking at all was a triumph. But we did notice when he spent time with friends who did use whining as a tactic, he was more likely to try it. I have zero tolerance for whining though, so it was cut off at the pass promptly every time. We said things like Sorry, I don't understand you, say it again? Say it in your usual voice? Just ask normally, don't use that tone. And the favourite Do you want some cheese with that w(h)ine? (When he was old enough to get the joke...)
I think we were lucky that our dc was quite amenable and also saw quickly that he got what he wanted more if he didn't whine and not at all if he did. Likewise, he was trained to ask for things like "can I have a drink please" and if he came back from a friend's house saying "I want a drink" I always pointed out "There's a nicer way of saying that..." It did work every time.
He also responded positively when told his grumpiness was having a bad effect on the rest of us so please try to be more cheerful again. But he's turned teenager now, we shall see what impact that has... 😬