The third counsel of St. John of Avila that leads a soul in the way to salvation, is:
Return thanks to God for all your spiritual graces, natural gifts, and every other good that you possess, attributing nothing to yourself except your sins, faults, and imperfections.
We cannot create grace; we can only receive it from the Lord. He provides all we need. He will not disappoint nor will He abandon us. This does not mean that pain and suffering will be absent from our life. The Lord will, however, turn any pain and suffering into movements of grace and salvation. In the Lord we find peace.
The Lord freely bestows His grace, we accept or refuse. The source of our sins, faults and imperfections is our refusal of His grace. The summit of our refusal is desolation and suffering.