When the writers of the scriptures speak of gaining charity, they speak of praying for it:
Wherefore, my beloved brethren, pray unto the Father with all the energy of heart, that ye may be filled with this love, which he hath bestowed upon all who are true followers of his Son, Jesus Christ; that ye may become the sons of God; that when he shall appear we shall be like him, for we shall see him as he is; that we may have this hope; that we may be purified even as he is pure. Amen. (Moroni 7:48)
It is through gaining a greater understanding of Christ’s love for you that you will gain that same love for others. When you pray for charity, you are praying to better understand the love of Christ for you.
In order to understand God’s love for you, you must understand more than you presently do about God’s greatness, God’s suffering, and your contributions to God’s suffering. While learning these things causes great joy in God’s goodness, it causes immense pain to learn of your wickedness.
The experience of Alma provides a wonderful example of the pain that comes with the revelation of one’s wickedness, as well as the joy that comes with the revelation of more of God’s goodness, as well as the invariable desire for the welfare of others that comes with it:
11 And the angel spake more things unto me, which were heard by my brethren, but I did not hear them; for when I heard the words—If thou wilt be destroyed of thyself, seek no more to destroy the church of God—I was struck with such great fear and amazement lest perhaps I should be destroyed, that I fell to the earth and I did hear no more.
12 But I was racked with eternal torment, for my soul was harrowed up to the greatest degree and racked with all my sins.
13 Yea, I did remember all my sins and iniquities, for which I was tormented with the pains of hell; yea, I saw that I had rebelled against my God, and that I had not kept his holy commandments.
14 Yea, and I had murdered many of his children, or rather led them away unto destruction; yea, and in fine so great had been my iniquities, that the very thought of coming into the presence of my God did rack my soul with inexpressible horror.
15 Oh, thought I, that I could be banished and become extinct both soul and body, that I might not be brought to stand in the presence of my God, to be judged of my deeds.
16 And now, for three days and for three nights was I racked, even with the pains of a damned soul.
17 And it came to pass that as I was thus racked with torment, while I was harrowed up by the memory of my many sins, behold, I remembered also to have heard my father prophesy unto the people concerning the coming of one Jesus Christ, a Son of God, to atone for the sins of the world.
18 Now, as my mind caught hold upon this thought, I cried within my heart: O Jesus, thou Son of God, have mercy on me, who am in the gall of bitterness, and am encircled about by the everlasting chains of death.
19 And now, behold, when I thought this, I could remember my pains no more; yea, I was harrowed up by the memory of my sins no more.
20 And oh, what joy, and what marvelous light I did behold; yea, my soul was filled with joy as exceeding as was my pain!
21 Yea, I say unto you, my son, that there could be nothing so exquisite and so bitter as were my pains. Yea, and again I say unto you, my son, that on the other hand, there can be nothing so exquisite and sweet as was my joy.
22 Yea, methought I saw, even as our father Lehi saw, God sitting upon his throne, surrounded with numberless concourses of angels, in the attitude of singing and praising their God; yea, and my soul did long to be there.
23 But behold, my limbs did receive their strength again, and I stood upon my feet, and did manifest unto the people that I had been born of God.
24 Yea, and from that time even until now, I have labored without ceasing, that I might bring souls unto repentance; that I might bring them to taste of the exceeding joy of which I did taste; that they might also be born of God, and be filled with the Holy Ghost. (Alma 36)
This experience is not unique to Alma. All believers who have come to comprehend their past sins and God’s love for them come away with a love of all mankind. Consider Enos’ experience:
4 And my soul hungered; and I kneeled down before my Maker, and I cried unto him in mighty prayer and supplication for mine own soul; and all the day long did I cry unto him; yea, and when the night came I did still raise my voice high that it reached the heavens.
5 And there came a voice unto me, saying: Enos, thy sins are forgiven thee, and thou shalt be blessed.
6 And I, Enos, knew that God could not lie; wherefore, my guilt was swept away.
7 And I said: Lord, how is it done?
8 And he said unto me: Because of thy faith in Christ, whom thou hast never before heard nor seen. And many years pass away before he shall manifest himself in the flesh; wherefore, go to, thy faith hath made thee whole.
9 Now, it came to pass that when I had heard these words I began to feel a desire for the welfare of my brethren, the Nephites; wherefore, I did pour out my whole soul unto God for them.
10 And while I was thus struggling in the spirit, behold, the voice of the Lord came into my mind again, saying: I will visit thy brethren according to their diligence in keeping my commandments. I have given unto them this land, and it is a holy land; and I curse it not save it be for the cause of iniquity; wherefore, I will visit thy brethren according as I have said; and their transgressions will I bring down with sorrow upon their own heads.
11 And after I, Enos, had heard these words, my faith began to be unshaken in the Lord; and I prayed unto him with many long strugglings for my brethren, the Lamanites. (Enos 1)
Enos prayed first for his own soul; second for his countrymen; third for his mortal enemies. He had developed a love for all mankind.
Ammon and his brothers learned of God’s love in the same way:
17 Who could have supposed that our God would have been so merciful as to have snatched us from our awful, sinful, and polluted state?
18 Behold, we went forth even in wrath, with mighty threatenings to destroy his church.
19 Oh then, why did he not consign us to an awful destruction, yea, why did he not let the sword of his justice fall upon us, and doom us to eternal despair?
20 Oh, my soul, almost as it were, fleeth at the thought. Behold, he did not exercise his justice upon us, but in his great mercy hath brought us over that everlasting gulf of death and misery, even to the salvation of our souls.
21 And now behold, my brethren, what natural man is there that knoweth these things? I say unto you, there is none that knoweth these things, save it be the penitent. (Alma 26)
Ammon realized that only those who had come to a knowledge of their sins could come to see the love of God the way a sinner does.