General McClellan started out as young cadet at West Point, where he eventually graduated second in his class. He fought honorably in the Mexican War and taught military engineering at West Point. Interestingly, he was to meet his future President and Commander in Chief, Abraham Lincoln, when he became the Head of Engineering at Illinois Central Railroad in 1857, after he resigned from the service. At the time, Lincoln was retained by the railroad as its chief lawyer.
When the war started, McClellan again entered the service. He was given command of Union forces in Virginia. In July 1861, he was to take control of the Army of the Potomac after the disastrous Battle of First Bull Run in Virginia. Here, McClellan shone as a first class general who knew how to whip his troops into shape, instill much-needed discipline and raise the morale of his battle-weary troops. In fact, due to this characteristic as an officer, plus his demeanor, he was nicknamed "Young Napoleon." However, his prowess with organization, discipline and tenacity did not extend to the battlefield. Paradoxically, he was cautious to a fault when it came to taking risks in battle. He was so cautious that his troops were not able to press home the advantage in the Seven Days Battles and he was not able to push back General Lee and his Confederate troops and take Richmond from the Confederates. Furious and dissatisfied with the timidity of his general, Lincoln gave over most of McClellan's command to General John Pope.
Interestingly, just like before, Lincoln had to call in McClellan again after a disastrous loss, this time at the Second Battle of Bull Run. Lee had defeated Pope in this battle in August 1862, and Lincoln was desperate for some action. This is the only reason why Lincoln reinstated McClellan. Desperate to recoup losses, he discarded Pope and called in McClellan to shape up the troops. To his credit, McClellan did give Lincoln some hope when he beat back Lee at the Battle of Antietam. However, for some reason, McClellan stubbornly refused to follow up by pursuing Lee's army and defeating him. Basically, Lincoln was furious that McClellan did not finish up the job he started. Eventually, McClellan did pursue Lee, but he took nine days to cross the Potomac after him. This spelled the end for McClellan's reign as Commander of the Army of the Potomac.
Hope this helps. Below are two links pertaining to your question that you may enjoy reading about. Thanks for the question!