Tags identify what an object is.
if (other.CompareTag("Player")) { }
Find by tag:
GameObject player = GameObject.FindGameObjectWithTag("Player");
Layers are commonly used for:
[SerializeField] private LayerMask groundLayer;