How to make an object only respond to a character?

Hi! I have an object in my game (the first level) that is a coin. It has code to teleport the player to the next level when it is touched. However, the game involves dragging rigidbodies around to get to the coin, and i the rigidbody touches the coin it skips to the next level. How can I make it so the coin only responds to the character?

check whether the object is ur playerObject tag…

void OnCollisionEnter(Collision collision) {
 
if (collision.gameObject.tag == "makeAtag..PutItHere.."){
//tele to lvl

}

}

or

    void OnTriggerEnter(Collider collider) {
     
    if (collider.gameObject.tag == "makeAtag..PutItHere.."){
    //tele to lvl
    
    }
    
    }

if you want to pass through it.

For Coin you should use OnTriggerEnter

void OnTriggerEnter(Collider cldr)
 {
   if(cldr.GameObject.tag == "coin")
      {
          Debug.log("Perform Your Action...");
       }

 }