My camera is Canon EOS M50 The lens is CANON EF-M 55-200MM F/4.5-6.3 IS STM

It makes a whining sound when I try to focus/auto focus. It tries to focus but it does not work. How should I go on about fixing it?

I don’t know much about cameras so I came here looking for help