As a shareholder, your best course is usually to negotiate the sale of your shares to the company, other shareholders, or a third party. Your ability to do this, and the price you receive, may depend on any restrictions in the company's articles of association or a shareholders' agreement. Commonly there will be a mechanism laid down, in either of these documents, for calculating value if you are a minority shareholder, but this may well be calculated as a minority holding, rather than a straight percentage of the total value of the company. If the shareholder and board cannot agree a price then there may be provision for an independent expert (usually a chartered accountant) to value the shareholding.
As a director, you may have no alternative but to resign. If you simply disagree with the strategy being pursued by the board, this provides a straightforward solution. However, if your resignation is prompted by concerns over the legality of the board's actions, you should take legal advice; resigning might not protect you from potential future liability for decisions taken while you were a director.