I do this trick that I discovered right in that moment. where whenever I feel like I am about to laugh, I just inhale heavily and exhale heavily until the urge is gone, works 100% of the time
Someone I knew was in that class assumed I was the one who did it because I was notorious for doing silly things like that