If you meet some requirements, such as you will work at the same activity content as you did before,
the period of your residence qualification can be extended.
There are employment support organizations to assist foreing workers in Japan.
Do not give up yet.