My workplace, where I've been working for 6 years now, has become more and more toxic the past few years and I've been considering to quit. Specifically I've been thinking to notify them months in advance that I will quit, so that we can find someone else to replace me because I fear that the very small company may fall behind in its responsibilities if it loses me or any other employee right now and possibly go bankrupt.
Today, in a team call, my boss started shouting to us and basically blamed me for not working some non-pre-agreed extra time for no compensation during the last weekend. No need to go into more details but the call became VERY heated and has really pushed me to quit. I don't want though to make this decision before I calm down, I'd like to let this week finish and decide to send an email saying that I'd like to quit before June and that they should start looking for a replacement. I don't except to be fired because as I said without a replacement this would put the company (of 5 people) in great risk, but I wouldn't put it past my boss to fire me either way just out of misguided pride (because of this heated call when I asked him to not shout at me).
So my question is: Should I make the decision to quit right now so that I don't risk getting fired? Or is being fired not that bad given that I've been working there for 6 years, so it was unlikely that I was doing a bad job? I'm afraid of what he could say to my future employers.
Thank you very much for your help