I got good news and bad. Almost all students suffer what you are suffering. The bad news is that about 1/3 give up because of it. The good news: those who pull themselves through are better for it.
In your learning you have just learned a solid truth. And this truth will carry you through some pretty shitty times. And the truth that you now know is that in the grand cosmos of reality we may mean nothing. Later on you will see that as a freedom.
But the really cool part is that now you must ask if this is truth (that we all just die) then for what purpose am I here. And the light bulb should get turned on. It is for joy and happiness. And the truest joy and happiness is in helping others get through this life with joy and happiness.
Now I am going to give you some homework to work into and through this, yes first into. Your feelings are valid and righteous. They are yours. Own them. Know them. Turn off the distractions and get into the thoughts and work right through them. Battle them and conquer them.
Your school work is important but this crisis is more important. It will define you for years to come. Be a victor or these thoughts not a victim of them.
I am old and still call upon the power I obtained when I battled these demons and won. You wrote this question. You are already on the road to kicking ass and taking names.
Practical steps to take are: Exercise, Nature, commit to a cause, go out and help somebody and talk to somebody about the issues you face.
I am already seeing you as you are past this and flourishing. My people need good people like you.