I find it useful to optimize by "buckets", each of which has different tax characteristics. First your income spills into the buckets, then your long-term capital gains layer on top of your ordinary income. So for 2018 taxes if you earn $50,000 income with $10,000 long-term capital gains (I'm rounding off here to send the signal that you can't rely on this for tax advice):
up to $12k, income tax of 0% (standard deduction), $0 owed
$12k - $21k, income tax 10%, $900 owed
$21k - $50k, income tax 12%, $4700 owed
$50k - $60k, capital gains taxed at 15%, $1500 owed
First you figure out your tax on ordinary income, then you get taxed on capital gains.