Per IRS Instructions for Form 1040 and 1040-SR, on page 29:
Capital Gain or (Loss)
If you sold a capital asset, such as a stock or bond, you must complete and attach Form 8949 and Schedule D.
Exception 1. You don’t have to file Form 8949 or Schedule D if you aren’t deferring any capital gain by investing in a qualified opportunity zone fund and both of the following apply.
If Exception 1 applies, enter your total capital gain distributions (from Box 2a of Form 1099-DIV Dividends and Distributions) on Line 7 and check the box on that line.
Note that any link in the information above is updated each year automatically and will take you to the most recent version of the document at the time it is accessed.