Of course, the ancestors of the African Americans (or at least some of them) came from the continent of Africa. (I say “at least some of them” because many African Americans today have ancestors who were white or Native American or from some place other than Africa.) They were taken from Africa during the time of the slave trade and were brought to the Americas.
Given the geography of Africa and the Americas, it makes sense that that the Africans who were taken as slaves would have come from Western Africa. That is the side of Africa that faces the Americas and so the majority of slaves came from that area. The great majority of people who were taken from Africa came from the area between what is now the Democratic Republic of Congo and the Sahara Desert. This is a large portion of the West African coast and includes the lands that now make up many different countries. The modern countries that were the greatest source of these slaves are Benin, Ghana, and Nigeria.