A lot of different ways, people named miller or skinner or carpenter usually have ancestors who had those professions, so that is the name they took. Then some people named Anderson, Johnson, Sampson, or anything of the like come from ancestors who had a father with the name of Johnothan, Samuel, Andrew, and the sons took their name and added son at the end, so that their heritage was known. People with last names like Fox, Beary, or anything of an animal it usually means they where a hunter of some sort. Hope this helped.
Depends what you did. If you made barrels your trade was "Cooper" so you were called cooper. If you had a son he chose the name O'Cooper. "O" meaning "son of". Like O'Connor which means "son of Connor: