There were many ways that this was done and the methods changed to some degree over time.
For example, right after the end of the Civil War, the whites tried to do this through the “black codes.” These laws formalized the status of blacks now that they were not slaves. But they also did things like requiring blacks to have work and allowing their labor to be sold to the highest bidder if they did not.
Later, after Reconstruction, came the Jim Crow era which is when restrictions on civil rights and liberties became much more formalized and elaborate. This is the era when African Americans were prevented from voting. This was done through legal means such as poll taxes, literacy tests, and the “white primary.” It was also done through intimidation. This is also the era when Jim Crow laws started to be enacted. These laws significantly reduced the civil rights of African Americans. They did so by creating an elaborate system of segregation to keep blacks subordinated to whites.
In these ways, African Americans were deprived of their civil rights and liberties in somewhat different ways at different times in history.