I often find saying that I'm not into X lands better than saying I don't like X. It's just an euphemism for the same thing, but it matters.
Also it's kinda important that your preference announcement makes sense in the moment, like when someone links you a rock song, saying you're not into rock is different than saying you don't like the song, but that would be an appropriate moment. If you go into a bar and there's rock background music, saying that you don't like it feels unprompted.
If coworkers/friends are talking about going to a rock festival in a bar, it's appropriate to say you don't like the music if they invite you, but inserting your opinion into their planning feels like you are rejecting their plan, which again will make them take it personally. You probably aren't against them going a bunch of days, getting hella drunk and having a good time while listening rock, you just don't like the music.
So yeah, appropriate time (when prompted or if not saying it will result in you not enjoying yourself) and appropriate manner (soft terms and extending the answer a sentence to give a bit of context) usually helps, a lot.
Just making a tone that with friends I oftentimes intentionally use extra harsh terms because it's funny and there's confidence, but if not, soft terms always.