You could approach your teacher politely and say something like:
"Hi [Teacher's Name], I hope you’re having a good day! I was wondering if I could go to the library to study for a bit. I think it would really help me focus. Would that be okay?"
This shows your respect for their authority and your intention to make the most of your study time.