The people of Limhi were somewhat disgusted with themselves. They were tired. Fighting had not worked. They finally turned to the Lord: "[T]hey did cry mightily to God" (21:14). They trusted him and served him.
How did the people of Limhi serve God? They served their fellow man. They especially took care of the increased number of widows and orphans in their midst (21:17), as Exodus 22:22 required them to do. Soon they would encounter Ammon (21:23), who had with him the words of King Benjamin, which the people of Limhi embraced with enthusiasm. I imagine that when they heard Benjamin’s words, "When you are in the service of your fellow beings you are only in the service of your God" (Mosiah 2:17), they were fully prepared to enter into the covenant to "serve him and to keep his commandments" (21:32), since they had already begun to live in harmony with several of Benjamin’s words about serving one another and imparting their substance to those in need. Importantly, we also learn this lesson again in our own dispensation. When the Saints were expelled from Jackson County, Missouri, and wanted to know why this had happened, the Lord revealed the answer in Doctrine and Covenants 105:3, "But behold, they have not learned to be obedient to the things which I required at their hands, but are full of all manner of evil, and do not impart of their substance, as becometh saints, to the poor and afflicted among them."