A Roman Legion had 10 cohorts of 500 about men each one. Each cohort had about 500 heavy infantry men (armored whit sacale or chainmail armor, and later with the famous "lorica segmetata", a plate cuirass) armed with shield, pilum, gladius and puggio, and about 100 men called velites armed "randomly" with small shields, slings, bows, javelins and a very light armor. Head armor varied a lot, from earlier greek-corinto like designs (closed helmet) to later open and lighter helmets (as "coolus").
Thus, in a cohort the infantry formed a 20x20 formation, flanked by its velites. So, shielded (heavy infantry) men resisted charges while velites hostigated the enemy. Heavy infantry throwed its pilum (made to kill or neutralize enemy shields due its large iron edge) and after formed a shields wall. Then used their gladio (roman short sword) only thrusting with it in a very close formation like modern police does in city disturbs, puggio was a small backup knive. So, the enemy had very little space to handle his weapons while romans were safe behind their shields. Velites flanked and hostigated the enemy throwing projectiles, and helped in close combat if necessary; they actuated as light guerrilla infantry being off-formation.
What about legion structure? The cohorts could form in battle in a variety of ways, but the most commons was the "hastati", "principae" and "terciati" one. Its said that 5 cohorts were hastati, 3 principae and 2 terciati. Hastati formed in a first row creating the line battle, so if they were overwhelmed by the enemy they coould retire among pricipae lines (formed behind). If again, hastati and principae were routed, the retired between terciati lines. If finally routed, battle was lost. In case romans were going to win, generals send terciati or principae to flank the enemy lines.
Also, in a legion there was cavalry (about 300), composed of very light armored (earlier one even lacked good armor), longsword and no spears. After, round shields, armor and even spears were used as the auxillia cavalry was developed (about 100-150). Cavalry was used to flank the enemy, never to front-charges if they could avoid it. Also, auxillia cavalry was used as mounted velites. To end, there was a "free" part of the legion composed by "free velites" and bodyguards for the general (the consul). Free velites were normal velites not attached to a cohort and the general decided what to do with them. Also bodyguards fought mounted or by foot as the commander did. Later, dont remenber when, praetorian guard was formed, it was a elite bodyguar unit, heavily armored and formed by italian young aristocratics and ascended soldiers.
A consul had two legions under his command, thus forming a consullar army, wich was the most common organization. Each legion formed nex to the other as told above.
About "officers". For each ten soldiers, there was a "decurion" equiped equally as his soldiers, so each cohort had 50 infantry decurions and 5 for velites; they formed at the edges of 20x20 formation lines. For each 100 soldiers there was a "centurion", so a cohort had 4 centurions (there werent for velites) standing at each corner. Each cohort had its set of music, standart and "main officer" (dont remember its name, maybe constable). A consul elected by senate commanded two legions with his bodyguards, ussually there were only two consuls. Consuls and praetorians are supossed to used a different sword than infantry.
At last, infantry was chosen by a particular sistem from villages and towns, cause they were already used to carry heavy loads and had a hard life at fields. Cavalry was elected by the same way from cities population. Only roman citiciens of the provinces (wich was above from civilian status) where allowed to join legions, and they had stablished days each year to practice with weapons (so in this way they were skilled when called to arms). During campaings soldiers earned a salary and sometimes a part of the booty. After war they returned to they normal life as veterans (so at enxt call they could be chosen as officers). Also officers sometimes get some lands and properties as reward. Later this derived in a corrupted senate, wich desired the profits of war instead sharig it with legionares, that was the begginig of the emperors era. They started as possition for times of crisis, elected by senate and with full-powers. After they turned to permanent and hereditary, taking profit from senate´s corruption and barbarian threats.
Emperors as Maximillian and Marius changed everything, barbarians joined the army in exchange for lands, legion sistem was left, permanent army was created and so on, the "proffesional soldier". This began with the emperors era and derived in several civil wars in wich a general or another was the new emperor.
Sorry for the long post and spelling mistakes. I hope it will be useful to you.