Music can be very helpful to listen to when trying to focus, if you choose the right sort of music. I've found the best music for focus tends to be instrumental, experiment and discover what works for you. Look for genres such as ambient, jazz, classical, and atmospheric electronic. Background music is all you need.
Below, I've put together a playlist full of mellow background music that I listen to to help me focus.