It all depends on how much risk you’re willing to take.
When interest rates go up, bond prices go down.
High yield bonds are sold by companies needy for money and willing to pay higher yields to get it.
When the economy sinks, those companies may face other problems.
So you get higher yields now — but potential greater risk if rates continue to rise and/or if there is a recession.