For me, getting "in the zone" is the way to perform the best work. What is the zone? It's the point in time and space where you're 100% present, laser focused on the thing you're doing.
If I can't focus 100% on the thing I'm doing, the result will be average.
Music is essential to me while trying to get "in the zone" when coding or writing.
To me the best kind of music for coding is 100% instrumental, with no voice at all.
If there's voice, I can feel some part of my mind is trying to process the voice and turn it into information. 100% instrumental avoids that.
But I also need some music that has rhythm. I can't code to new-age meditation music. That's too "soft", if there is any noise in the background I'm going to hear it, and it will distract me.
My favorite genres lately are Synthwave and Sovietwave. If you search for those on YouTube you'll find some video collections of super cool music and visuals which are nice to see while coding. After finding a few I like I downloaded those videos as mp3 and I play them without having to keep a video open all the time.
Music for programming https://www.musicforprogramming.net is a nice site to find some good background music.
Other music I like is Casey Neistat background music.
Another great channel I like to tune in for music is Xerf Xpec or Kuma's campfire. On those you can find some fancy old school Japanese music like https://www.youtube.com/watch?v=ypdnSS0La7s or https://www.youtube.com/watch?v=6GEI3PpXEAo, which is a good companion to a coding session.