Yes, it was extremely difficult. During the 1800s, segregation denied African Americans access to education. Most states outlawed their schooling; those caught learning faced severe punishment. Even where schools existed, they faced discrimination, inferior resources, and limited curricula compared to white students.
Despite this, many risked everything to learn, demonstrating remarkable resilience. While significant progress has been made since, disparities in educational attainment and literacy between African Americans and whites persist today.