IDIOMS

give what for

(transitive, idiomatic) To scold; to punish, especially verbally.

Example:   When she found out, she really gave him what for.