Your first responsibility is to act in the best interests of the company and its creditors at all times. You should ensure that the company does not continue incurring additional liabilities when there is no reasonable prospect of avoiding insolvency. Doing this could constitute wrongful trading and could make you personally liable for the company's debts. You must obtain specialist insolvency advice as soon as possible.
If there is a reasonable chance of saving the business, you will need to take the appropriate action - for example, negotiating new financing and working with your creditors to reach an amicable solution. And if there is not, you should instigate the appropriate insolvency proceedings.
Be aware that these liabilities apply even if you are only a part-time or non-executive director.