Foreigner filing U.S. taxes with form 1040-NR. I own stock of a U.S. company in a foreign brokerage account and had U.S. tax withheld from dividends based on form W-8 BEN. How do I report this income on my tax return?
Assuming you weren't operating a trade or business in the US that you omitted from your Q, this is 'not effectively connected' income. Report on (now-separate) schedule NEC line 1a, and the withholding on 1040NR line 25g.
However if this was your only US-taxable income and the withholding was correct -- either you are subject to the default 30% rate and 30% was withheld, or you specified the correct treaty rate on W-8BEN and that rate was withheld -- then you don't need to file at all. See table A item 2:
You must file Form 1040-NR if ... 2. You were a nonresident alien not engaged in a trade or business in the United States during 2021 and:
a. You received income from U.S. sources that is reportable on Schedule NEC, lines 1 through 12; and
b. Not all of the U.S. tax that you owe was withheld from that income.
Conversely if this is the only item that applies to you and all the tax you owe was withheld, you are not required to file. (But you are permitted; if you were over withheld, of course you should voluntarily file to get the excess refunded.)