For the same wave, the product product of
(wavelength) times (frequency)
is always the same number. (It happens to be the speed of the wave.)
So if one of them changes, the other one has to change in the opposite
direction, in order to keep their product constant.
For electromagnetic waves, higher frequency means higher energy.
I'm not sure about mechanical waves just now.