This verse sings about the benefit of a good relationship between the believers and the Lord: they praise God and live together with him. That can also be the case when your life is difficult.
At some point, however, it will be in unbrokenness. Our lives will be fully healed and good one day. Remember what Jesus has said about this in Matthew 5:8: Blessed are the pure in heart, for they shall see God.
13 Surely the righteous shall give thanks to your name; the upright shall dwell in your presence.