Better not teach beginners to use tags for cases like this, it’s a bad practice. Since we have a Player script only on player, would be easier to check if collided object has it. Same one line of the code:
void OnCollisionEnter(Collision collision) {
if (collision.gameObject.TryGetComponent<Player>(out Player player)) {
// it was a player!
}
my point is - Tags should be never used in the code. They should be something that exist only in Editor for better Asset-management (for filtering in Asset-manager). You should never do CompareTag("tag") in the code.