3K of the 4K excess loss will offset 3K of ordinary income. Although dividends and long-term capital gains are taxed at the same rates, this does not mean capital losses can be used to offset dividends. However, if you have a net capital loss after offsetting all capital gains, up to $3,000 per year of capital loss may offset regular taxable income, which may include dividends. The balance will be carried over to the 2020 tax year.
Answers are correct to the best of my ability but do not constitute legal or tax advice.
**If this post is helpful please click on "thumbs up"**