The 14th amendment, passed in 1868, was passed during the Reconstruction era. This was the time period immediately following the Civil War. This amendment stated that anyone who is born on US soil is considered a citizen and they have equal protection under the law. This officially overturned the Dred Scott vs Sanford case, which established the idea that slaves were property and not people. This is the main reason why an amendment like this was needed.
After this amendment was passed, southern states and their citizens still tried to get around this law. Certain limitations were put on African-American citizens when voting, attending school, etc. Eventually, the court rules in the Plessy vs. Ferguson case that "separate but equal" is allowed and does not go against any of the constitutional amendments.