The Civil War was fought in order to stop slavery. When the Civil War was underway, Lincoln wrote and presented the Emancipation Proclamation. Even though many people believe that this document was written to stop all slavery in the United States, it did not give that much freedom. It was written as an executive order on January 1, 1863 which was right in the middle of the Civil War.
The main thing that this document and order do was to declare the enslaved African Americans in the southern states free. However, that may seem like all of the slaves were free, but there were states that were not part of the southern states that had slaves. This did not let them be free until the amendment was written years later.