Now when the Lamanites saw that their brethren would not flee from the sword, neither would they turn aside to the right hand or to the left, but that they would lie down and perish, and praised God even in the very act of perishing under the sword--The slaughter of the Anti-Nephi-Lehies brought about the conversion of more Lamanites. Their deaths were not in vain; they provided an opportunity for the wicked to recognize and repent of their sins. The loss of their physical lives resulted in the spiritual salvation of others' lives (and the physical salvation of all the righteous people those Lamanties would have killed had they remained wicked).
Now when the Lamanites saw this they did forbear from slaying them; and there were many whose hearts had swollen in them for those of their brethren who had fallen under the sword, for they repented of the things which they had done.
And it came to pass that they threw down their weapons of war, and they would not take them again, for they were stung for the murders which they had committed; and they came down even as their brethren relying upon the mercies of those whose arms were lifted to slay them.
And it came to pass that the people of God were joined that day by more than the number who had been slain . . .
. . . there were more than a thousand brought to the knowledge of the truth; thus we see that the Lord worketh in many ways to the salvation of his people. (Alma 24: 23-27)
While it is more common for people to turn away from God in times of suffering, we learn from this encounter that trials are opportunities to become closer to Him, both for victims and oppressors. The Anti-Nephi-Lehies were saved for keeping their covenants (Alma 24:26), and their righteous actions changed their enemies' hearts. We too should find the opportunity in our trials and tragedies to become closer to God and help others know Him, and we will be blessed for it.
Challenge: Next time you are experiencing tribulations in your life, turn to God instead of away from Him.