Han Solo is definitely an important character but in my opinion he should have died in ESB but of course I'll explain why he didn't die.
The mentor rule
I have a book about cinematic rules, and one of the most important ones is: the mentor always dies. This means that the protagonist will have to face the final mission alone, without the help of the mentor who obviously will either die, or in any case will not help him. For example Gandalf in The Lord Of Rings, Dumbledore in Harry Potter and so on in many other films. Now, taking this rule into consideration we can understand that in almost every star wars movie there is a mentor who dies.
TPM: Qui Gon Jinn
AOTC: Shmi Skywalker
ROTS: Literally half the world dies
ANH: Obi Wan
ROTJ: Yoda and Anakin
TFA: Han Solo
TLJ: Luke Skywalker
TROS: Leia Organa
Now surely you've noticed something: in ESB no one dies, which is exactly why in my opinion Han Solo should have died when they froze him in carbonite
Reasons why Han didn't die
Obviously if Han Solo had died in ESB, two major problems would have affected the storyline
1. Jabba and Boba Fett would not have died
We all know that Jabba and Boba were killed because Luke, Leia and Lando went to Jabba's palace to retrieve Han, but if he died, these antagonists would not die , because no one would come to Jabba's palace. But in this case they could have invented another excuse, for example one that I have always imagined, is that Jabba after Han's death demanded the money from Solo's debts from Luke and Leia.
2. Luke and Leia are siblings
This is the main reason Han Solo isn't dead. Initially the love story was between Luke and Leia, but the two are siblings, then Leia is with Han, and that's exactly why he's not dead. If Luke and Leia hadn't been siblings and got together, Han would have been "the third wheel" and then he could have died, but with the fact that he's with Leia, he can't.
Do you also think that Han should have died?