it’s often not enough to simply ignore the whining (even announcing you can’t hear them is still attention for whining)…you’ll need to notice the not-whining. Children often whine for attention they feel (reasonably or not) they aren’t getting otherwise.
So when they are “being good” you have to engage positively instead of sighing "thank goodness " internally. Whining is hard, but often just a stage in learning how to interact with people.