Hi,
You have to report the full W-2 income, but you will receive a 1099-B from the brokerage firm/institution that you sold the investments/stocks from, and the total of those transactions will be shown on schedule D of the 1040.
You will then be able to use a 3,000 capital loss in 2023, the remaining 7,000 loss will be carried forward to future years. You can then use 3,000 each year until the full loss is exhausted.
Here is an article about capital losses:
https://turbotax.intuit.com/tax-tips/investments-and-taxes/capital-gains-and-losses/L7GF1ouP8
Thank you,
John
CPA