This is the 748th most frequent Korean word.
직전
"직전" means "just before" or "right before."
In this sentence, '직전' is used to indicate that the action of drinking coffee happened immediately prior to the class.
수업 직전에 커피를 마셨어요.
I had coffee right before the class.
Here, '직전' describes the time frame just before he finished work.
그는 퇴근 직전에 상사가 부르는 소리를 들었다.
He heard his boss calling him just before leaving work.
The usage of '직전' here demonstrates the close timing relationship between the rehearsal and the performance.