Long ago people didn't use last names, but when lots of people had the same or similar first names descriptions were added to make it clear who was being talked about. (I guess humans have always talked about other people.) Eventually those tags stuck and became surnames.
Often those last names were jobs. For example John Clark (clerk,) John Baker, John Black (short for blacksmith) and John Farmer were known by their occupations. Others were derived from the place someone lived or had come from, or, if they were servants, their owner or boss. My last name, Collins, meant Colin's.
Women and children weren't considered important so they were simply known by the name of their husband or father, and if a father was well known his sons might still be know as his son when they grew up.
These are English examples, but family names in many other languages were also derived from occupations, locations, and the fathers' first names.
Do you know the original meaning of your last name?