Using earplugs or listening to music through headphones is the best way to focus on a noisy classroom. Moreover, if you use active noise-cancelling headphones, you can just turn on the ANC and get a quiet environment even without music.