How to keep your stock profits from being taxed. You can decrease or eliminate your tax payment on your gains if you sell certain stocks for a loss in the same year that you make a profit on winning ones. Long-term losses are first offset by long-term gains, followed by short-term gains.