Passage
I will praise thee with uprightness of heart, when I shall have learned the judgments of thy justice.
I will praise thee with uprightness of heart, when I shall have learned the judgments of thy justice.
Psalms 118:5 O! that my ways may be directed to keep thy justifications.
Psalms 118:6 Then shall I not be confounded, when I shall look into all thy commandments.
Psalms 118:7 I will praise thee with uprightness of heart, when I shall have learned the judgments of thy justice.
Psalms 118:8 I will keep thy justifications: O! do not thou utterly forsake me.
Psalms 118:9 By what doth a young man correct his way? by observing thy words.
The verse centers on "praise", "thee", "uprightness", "heart", "shall", "learned", "judgments", and "justice". It is saying that the verse draws attention to "praise" and "thee", so its meaning should be read from those terms before moving to application.
The nearby context moves from verse 6's "Then shall I not be confounded when..." into verse 8's "I will keep thy justifications O do...", so "praise" and "thee" belong inside that flow. In Psalms context, the local focus is worship, trust, the LORD's kingship, and covenant mercy.
A plain takeaway is to answer the verse's own emphasis on "praise" and "thee" with trust shaped by these words, not by a vague optimism outside the passage.