This literally happens to me all the time, I'll be as lost af in class and the teacher will be looking for a volunteer, all you gotta do is DO NOT MAKE EYE CONTACT, look really immersed in your work and what I like to do is fumble in my pencil kit for an eraser and pretend to erase, and boom.