Psalm 31:7

I will be glad and rejoice in thy mercy: for thou hast considered my trouble; thou hast known my soul in adversities;

I will be glad, and rejoice in thy mercy,.... Both because of the nature of it, which is large and abundant, free and sovereign, from everlasting to everlasting, and is communicated in and through Christ, and is a good ground of hope and trust; and because of the effects of it, or what it has produced; for to it are owing the covenant of grace, and all the sure mercies of it; the mission of Christ, and redemption by him; regeneration, and the forgiveness of sins, and even eternal life and glory; besides a multitude of blessings, deliverances, and salvations in Providence; on account of all which there is great reason for joy and gladness; of which the following are particulars;

for thou hast considered my trouble; inward, arising from indwelling sin, doubts and fears, desertions and darkness, and Satan's temptations; and outward, from the world, and the men of it, and by reason of bodily afflictions: now the Lord looks upon the troubles of his people, and upon them in them, with an eye of pity and compassion; he sympathizes with them; he considers the nature of their trouble, their weakness to bear it, and the best way, in tans, and time to deliver out of it; he working all things after the counsel of his own will; see Exodus 3:7;

thou hast known my soul in adversities; that is, the Lord had took notice of him, approved of him, loved him, had visited him, and made known his love to him, and owned him for his own, and had chosen him in the furnace of affliction; a time and season when oftentimes friends and acquaintance are shy, and will not look upon men, know them, and own them; but the Lord does otherwise, and which is another reason of joy and gladness in his mercy.