In a nutshell, music puts us in a better mood, which makes us better at studying - but it also distracts us, which makes us worse at studying. So if you want to study effectively with music, you want to reduce how distracting music can be, and increase the level to which the music keeps you in a good mood.
History
Citation
Byron, T. (2019). Curious Kids: is it OK to listen to music while studying?. The Conversation, 17 October 1-5.