OnCollisionEnter for other gameobjects (C#)

What i want to code (C#) is a trigger that activates, for example a timer, with an OnTriggerEnter.
However i want to stop the same timer with an OnTriggerEnter function for an other gameobject.
What i think (and hope) it whould look like:

public gameobject _Start; //(gameobject or Rigidbody etc?)
public gameobject _End;

private bool thebool;

void _Start.OnTriggerEnter(Collider otherobject)
{
thebool = true;
}

void _End.OnTriggerEnter(Collider otherobject2)
{
thebool = false;
}

This however, does not work so my question is:
‘How whould I make this work?’
I would apreciate any help and hope someone could help me.

void OnTriggerEnter(Collider other)
{
if(other.gameObject.name == “object1”){
// do something
}

     if(other.gameObject.name == "object2"){
     // do something 
    }
}

you can replace gameObject.name with gameObject.tag if you deal with many objects that you want something to happen when one of them entered the area but you have tag them in inspector first .

@Ali hatem
Sorry, i think you misunderstood me;
What i meant is: OnTriggerEnter only applies to the gameobject the script is placed in. I want to know how i would check if somthing collides with gameobject a if the script is in gameobject b.
I appreciate your help, but this was not what i meant (I am not very skilled in explaining, sorry).