Psalm 50:15

And call upon me in the day of trouble: I will deliver thee, and thou shalt glorify me.

And call upon me in the day of trouble,.... This is another part of spiritual sacrifice or worship, which is much more acceptable to God than legal sacrifices. Invocation of God includes all parts of religious worship, and particularly designs prayer, as it does here, of which God, and he only, is the object; and which should be performed in faith, in sincerity, and with fervency; and though it should be made at all times, in private and in public, yet more especially should be attended to in a time of affliction, whether of soul or body, whether of a personal, family, or public kind, James 5:13; and the encouragement to it is,

I will deliver thee: that is, out of trouble: as he is able, so faithful is he that hath promised, and will do it. The obligation follows,

and thou shall glorify me; by offering praise, Psalms 50:23; ascribing the glory of the deliverance to God, and serving him in righteousness and true holiness continually.