At the start of the Civil War, the entire United States Army consisted of some 16,000 men of all branches, with infantry representing the vast majority of this total. Some of these infantrymen had seen considerable combat experience in the Mexican-American War, as well as in the West in various encounters, including the Utah War and several campaigns against Indians. However, the majority spent their time on garrison or fatigue duty. In general, the majority of the infantry officers were graduates of military schools such as the United States Military Academy.
In some cases, individual states, such as New York, had previously organized formal militia infantry regiments, originally to fight Indians in many cases, but by 1861, they existed mostly for social camaraderie and parades.
Learn more in the WikiPedia Infantry in the American Civil War