"And Alma cried, saying: How long shall we suffer these great afflictions, O Lord? O Lord, give us strength according to our faith which is in Christ, even unto deliverance. And they broke the cords with which they were bound; and when the people saw this, they began to flee, for the fear of destruction had come upon them."
When I read this verse, two things came to mind. The first was that Joseph Smith pleaded to the Lord in a similar way while imprisoned in Liberty Jail (D&C 121). The second thing was the fact that Alma and Amulek had just witnessed the deaths of the innocent wives and children of those men who had believed on their words. As I thought of these two things, I wondered how a person knows what to pray for. How do we know what the will of the Lord is? When Joseph Smith prayed, wondering how long the Lord would allow the Saints to suffer at the hands of their enemies, he was in prison, but he did not ask for the Lord to give him strength to break out. Did he know that was not the Lord's will at the time?
In the earlier verses, when Mormon relates the burning of the wives and children he shares a conversation between Alma and Amulek. Amulek knew that through the power of the priesthood, he and Alma could stretch forth their hands and save the innocent people from their cruel death. But Alma told Amulek "the Spirit constraineth me." So how was it that Alma could pray for their own release but not the release of those women and children? The answer lies is found in another scripture: Helaman 10:5. In this verse the Lord tells Nephi, the son of Helaman, that whatever he prays for he will get, because "thou shalt not ask that which is contrary to my will." Helaman, as Alma, achieved a oneness with the Lord that he was able to know what the Lord's will was. Alma knew that the Lord had good reason for allowing the innocent people to die (so He could hold their lives against the wicked, see Alma 14:11); he also knew that the Lord desired for him and Amulek to escape, so that is what he prayed for.
So, if we want to know what to pray for, I suppose we'd better learn the will of the Lord!