How to mourn a loss?

My history teacher passed away recently and it is seriously fucking me up. I'm too scared to even go to his funeral cause I know I'll just break down, but if you have any tips that'd be great. I've dealt with death before, but only when I was really young. Like, elementary school, so now that this is happening, I feel like everything is spinning out of control, and I can't stop thinking about it. Whenever I walk past his classroom, I get this ache in my chest and it won't go away. It just hurts so bad and I want it to stop