Did i make the right choice?

I decided to resign and quit my first job just to focus on school because i have an upcoming diploma/final exam. I feel like what i did was stupid and regret that i quit. I feel anxious that they won’t rehired me after i done my exams.

I dont think it was a stupid choice you made. Talk to your old boss and explain how it is and that you really want to just focus on school til its done. He/she might understand why and rehire you when school is done <3