Need Help With my code.There is no error but my scene doesnt restart after colliding with the player

The obstacle isn’t colliding with the player even though I wrote the code correctly.
I think!!
Here is the code for PlayerController:

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class NewBehaviourScript : MonoBehaviour
{
 
    Rigidbody rb;
    public float jumpForce;
    bool canJump;


    private void Awake()
    {
        rb = GetComponent<Rigidbody>();
    }

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update(){
        if(Input.GetMouseButtonDown(0) && canJump){
            
            //jump
            rb.AddForce(Vector3.up * jumpForce, ForceMode.Impulse);
        }
    }

    private void OnCollisionEnter(Collision collision){
        if(collision.gameObject.tag == "Ground"){
            canJump = true;
        }
    }
    private void OnCollisionExit(Collision collision) {

        if(collision.gameObject.tag == "Ground") {

            canJump = false;
            
        }
        
    }
    private void OnTriggerEnter(Collider other) 
    {

        if(other.gameObject.tag == "Obstacle")
        {

            SceneManager.LoadScene("Game");

        }
        
    }

}

You are using OnTriggerEnter() to detect when the player touches an obstacle. A few things to check:

  1. There is a collider with ‘trigger’ active on the player.
  2. There is a collider with ‘trigger’ INACTIVE on the obstacle
  3. At least 1 object need a rigidbody.