Outside of a tax-deferred retirement plan, you should invest in a way that will minimize your taxes. You might choose a tax-managed mutual fund, for example. Such funds try to avoid making taxable distributions. If they take a gain on a stock, they might take a corresponding loss on another stock, as an offset. In that way, taxes aren’t passed through to shareholders.
Another option is to invest in individual stocks rather than stock funds. You can take losses and avoid taking gains, in keeping with your tax strategy. If you’d rather not pick your own stocks, many brokers offer “separate accounts” programs in which a professional money managers make the selections. These accounts can be customized to help minimize the taxes you’ll pay.