OnTriggerEnter has a weird bug, help me pls

As I said, the OnTriggerEnter function has a bug… I have a fairly simple game, where you have to complete a level and go around obstacles. Btw I’m a beginner in Unity. So, I want that that function triggers when I reach the end of the level, but that function gets triggered every time I touch the ground. Does anyone know how to solve this problem? Like I said, I’m a beginner so I have basically no idea. Thanks!

Can you please send the code?

Can you send the code? It may be that you are not looking for a tag, layer, name or other parameter.

    void OnTriggerEnter(Collider other)
    {
         // Do something..
         // Looks for any trigger enter by the object regardless of layer, tag or 
         // name or any other parameter.
    } 

If you want to look for a tag as well you could do:

    private void OnTriggerEnter(Collider other)
    {
        if (other.gameObject.CompareTag("Hazard"))
        {
            // Do something...
            // Checks for trigger enters while looking at a tag 'Hazard' on the trigger object
        }
    }

That looks for a tag. You could do this also by changing it to this:

    private void OnTriggerEnter(Collider other, string tag)
    {
        if (other.gameObject.tag == "Hazard")
        {
            // Do something... Same behaviour as first tag option
        }
    }