If you are a sole trader, you can sell the business or its assets (or form a limited company, transfer the business to it, and then sell the company).
If you are a partner in a partnership, the partnership agreement will normally specify under what circumstances (if any) you can withdraw capital and how this will be handled. Normally, you will be able to realise your investment only on retirement.