In 2020 I had stocks which gave dividends. I sold those stocks in 2020. How do I reflect this in 2020 USA Federal Taxes?
How do I report this Form 1099-DIV I received from my mutual fund?
Enter the ordinary dividends from box 1a on Form 1099-DIV, Dividends and Distributions on line 3b of Form 1040, U.S. Individual Income Tax Return, Form 1040-SR, U.S. Tax Return for Seniors or Form 1040-NR, U.S. Nonresident Alien Income Tax Return.
Enter any qualified dividends from box 1b on Form 1099-DIV on line 3a of Form 1040, Form 1040-SR or Form 1040-NR.
There's more, so read the whole link.
You'll get a form 1099-B for capital gains that instructs you to use Schedule D or Form 8949. That then goes on 1040 Line 7.
If you use tax software, it will guide you through inputting information from the 1099 forms you receive from your broker. Your broker might not provide your 'basis' (i.e. purchase price) for the stock that you sold, in which case you will need to look it up in your records or in the transactions tab at your broker's web site.