There are many ads when playing videos on the Youtube app, I have tried many things but nothing works. Is there a way to avoid all the ads?
Yes. You can avoid YouTube ads (except on paid channels and movies) by subscribing to the paid membership called "YouTube Red". This also enables you to save videos and songs for offline playback on a mobile device.
YouTube Red includes a subscription to the "Google Play Music" streaming service. (Or vice versa: If you subscribe to Google Play Music like I do, you get YouTube Red for free.)
The price (currently) is US$9.99 per month.
CNET has a summary on YouTube Red including a list of supported devices including the Android and iOS apps, Chromecast, Android TV, Apple TV, some game consoles, and some Smart TVs. CNET says YouTube will have some original shows and movies for Red members, if you're interested in that sort of thing.
(This answer sounds like an ad but I'm not a Google employee.)
Root your phone with Magisk, and then you can either install Xposed to get youtubeadaway, or some of the more recent modules in magisk. I have a black themed ad blocking app that actually installs over the YouTube app dad got through magisk in addition magisk systemless Lea Roots so you can still enjoy the things like Netflix and Android pay not having to sideload.I have a rooted phone and I get ad-free YouTube and I download YouTube for free. Download the XDA app takeoff look-see at the apps that they have on their site. One of the good ones you're never going to see on Google play. Hope that helps