Pattern of Prayer and Fasting
It seems that Alma often fasted and prayed for the welfare of the people who were not members of the church (Alma 6:6). Alma 8:10 gives us more insight into how fervently Alma prayed. I'm sure Alma's faith in prayer was very strong. It had worked for him many, many times and there was no reason for him to believe it would not work again for the people of Ammonihah.
Despite the great wickedness of the people, "Alma labored much in the spirit, wrestling with God in mighty prayer." (Alma 8:10)
I do not think that when Alma (Enos too … see Enos 1:1-12) was "wrestling with God" that God was opposed to his petitions. In these serious matters, one does not merely and nonchalantly ask God to make the people repent and "poof" the people repent. People's agency is at work in multiple ways. Rather, Alma had to struggle and work hard to exercise his faith in God. This is what is meant when he "wrestled with God."
When the people of Ammonihah rejected Alma the first time, he became "weighed down with sorrow, wading through much tribulation and anguish of soul, because of the wickedness of the people who were in the city of Ammonihah." How many times in our lives have we prayed so hard for something only to be "let down" because the thing we asked for was not granted? But is our faith strong enough to be patient and see beyond what was not granted?
Indeed Alma prayed mightily and endeavored to preach to the people, but souls would not be saved this way. The Lord had prepared a way for Alma to accomplish that which had been commanded him (1 Nephi 3:7).
One of the things I struggle with is to not only act, but to act quickly on revelation received. Alma did not struggle with this. After receiving his mandate from the angel, Alma "returned speedily to the land of Ammonihah." (Alma 8:18)
The House of Amulek
Thus begins one of the great stories of the Book of Mormon and perhaps my all-time favorite. Alma returned secretly to the city and asks Amulek for food. Amulek had received a vision wherein an angel told him to receive Alma into his house.
Amulek led Alma to his house and gave him food, drink and shelter.
"And Alma tarried many days with Amulek before he began to preach unto the people." (Alma 8:27) There is no doubt that as Alma preached to Amulek and his family that this prepared Amulek for what was to come. I'm sure during this time that they prayed and continued to fast for the welfare of the souls of Ammonihah. For when the time came for them to begin preaching, "they had power given unto them, insomuch that they could not be confined in dungeons; neither was it possible that any man could slay them." (Alma 8:31)