Tax Year Prior to 2020: Sale of options and restricted stock counted as ordinary income on w2

I exercised options and also sold restricted stock.  These were counted as ordinary income on my w2 and taxed.  They informed me that because of this I should not pay capitol gains tax.  How do I ensure this is done correctly