NASB
Thanksgiving for the LORD’S Favor.
A Psalm of David.
138:1 I will give Thee thanks [David expressed gratitude and praise even in the worst of times] with all [total devotion; withholding nothing] my heart [cf. Ps. 9:1];
I will sing praises to Thee before the gods [God is above all other objects of worship and all other alleged gods as well as earthly rulers; cf. Ps. 119:46 re kings and great men; cf. “kings” in verse 4].
138:2 I will bow down [David was bold enough to sing God’s praises before great men (138:1) yet humble enough to bow down before his great God] toward Thy holy temple [had not yet been built although it was a vision in David’s heart; cf. Ps. 5:7],
And give thanks to Thy name for Thy lovingkindness [grace] and Thy truth [cf. Proverbs 3:3-4 and John 1:14 re “grace and truth”];
For Thou hast magnified Thy word according to all Thy name.
138:3 On the day [of trouble; of need] I called [the natural response of a child in danger or in need] Thou didst answer me [the most reassuring thing for someone in distress];
Thou didst make me bold [the result of knowing that God is with you] with strength in my soul.
138:4 All the kings of the earth will [the day is coming; cf. Phil. 2:9-11] give thanks to Thee, O LORD,
When they have heard the words of Thy mouth.
138:5 And they will sing of the ways [cf. Ps. 103:7] of the LORD.
For great is the glory of the LORD.
138:6 For though the LORD is exalted [God’s majesty is unsurpassed in its highness],
Yet He regards the lowly [God’s majesty is unsurpassed in its regard for the lowly; God will bend low to rescue those in need, comfort those suffering afflictions, and make provision for the poor; “There is no pit so deep, that God’s love is not deeper still.” (Corrie Ten Boom)];
But the haughty [the proud and boastful and those who are critical of God and His purposes; pride keeps people focused on themselves and distracts them from seeking God; cf. James 4:6] He knows from afar [afar is not a good place to be].
138:7 Though I walk in the midst of trouble [sooner for later every person will find themselves in the midst of trouble], Thou wilt revive me;
Thou wilt stretch forth Thy hand [an expression that is synonymous with judgment] against the wrath of my enemies,
And Thy right hand [the pinnacle of strength and ability] will save me.

138:8 The LORD will accomplish [using trials and tribulations as tools to accomplish His purpose] what concerns me [I am the object of God’s love and care];
Thy lovingkindness, O LORD, is everlasting;
Do not forsake the works of Thy hands [God will not forsake His work; cf. Phil. 1:6].