One way is to find a partner to start your own company, because since you are a partner, you are not alone. For example, you look at this company with two other people, and now you don't want to work. You find these two people and tell them that I don't want to work in this company now for some reason, and you can do the rest yourself. Look at how much money you have now, and I'll give you this share, so I won't participate in the next business. If the other party can agree to return the money to you, that's fine, but if the other party doesn't agree, you can only choose another method.
Because starting a company itself involves a lot of strong cash flow, especially the start-up company itself has no cash flow and little cash. The money you invested at that time may have been spent now, so it is unlikely that you will let the other two partners take it out. Because they don't have that much money, but if these two shareholders don't want to buy and the internal shareholders don't want to buy back their shares, then you can naturally choose people outside the company. People outside the company are willing to buy your shares or spend more or less, as long as you reach an agreement.
Moreover, as long as you are a shareholder of the company, there is no such thing as retirement. The other two partners have no absolute obligation to say that you must give you money if you want to leave. This is true even if you go to court, because joint-stock companies don't retire. The money you paid at that time is now circulating normally in the company. If you suddenly leave and withdraw all the money from this company, the company may be finished, your visa is guaranteed, and other partners, so this matter is a trivial dispute.