How can I use a smartphone/tablet without being distracted by it in classrooms?
Just simply remove the apps from your tablet or disable them if you cant delete them.

If you want them to stay on the tablet then go into the app settings and configure them respectively. 

Also Do Not Disturb is your friend, I'd put it on a schedule and set it.