Kayla, good question and one that I think everyone has at some point.
For me, the answer was to figure out the ideal location to allow me to focus. I, personally, need to be secluded from other people and any potential distractions. In college, I found a corner of the library where I couldn't sit with my friends and I would put some music I knew really well so I wouldn't be distracted and could tone out what was happening me around me. I also would turn off the wifi on my computer so I could't start surfing the internet. In the end, I forced myself to be bored so the only relief from that boredom was to study.