I've played this cartoon video game for 8 years competitively. In those years I've been cut 4 different times. Two of them I had to re trial for my medic spot, Which IMO is worse than just being straight up kicked.
I struggle with depression and anxiety so when I got kicked it hit me harder than most.
Best thing to do is just get away from TF2 for a bit. Give it a few days then ask yourself if you want to keep playing and what you want to achieve.
I could have quit TF2 hundreds of times over but I always kept going because I hadn't achieved what I wanted.
If you do decide to keep playing this is valuable experience. You were kicked because of your TF2 performance so use that feedback and change your game.
Switching class is also an option too. It can make the game feel brand new.
I hope you find a new team and keep playing.