I think Xavi's decision to resign is the right one. Xavi loves this club. And he is a living legend of Barcelona. He was the coach of this club for the last 2 years. And despite Barcelona not being in a good position, the team won the La Liga title last season with the help of Xavi. But now Barcelona face a bigger problem. The team's performance this season has been erratic. Also their financial condition is not good. So Barcelona needs a more experienced coach.
If Xavi remains as the coach of the team, it will not be good for Barcelona and Xavi. Barcelona fans might start trolling Xavi too. Perhaps this is why Xavi has decided not to stay at Barcelona at the end of this season.
It is not profitable for Barcelona to fire Xavi now, due to money problems, they will not be able to hire a good coach, and it is clear that no one will agree to work for crumbs. So, most likely Xavi will work with the team until the end of the season, but he says that his decision is final, he will leave the team after the end of the season. So, in any case, the team will be coached by a new coach, but who it will be is still unknown. This situation will not be the best for the club, and if everything only gets worse, then perhaps a replacement for Xavi will be found earlier.