hit tag

How do make so like if I hit a entity it will give them a tag?
Continue to help post