how to set up a point system on collection

Hello I’m working on a demo for a platformer and im having a problem im trying to have my object which is named Data act as a point as in score system so when my player walks over it or collides it adds a point i have the collision done its just how would i add the point would it be a if statement if so were would i put it theres no need for update or start as i only have

void OnTriggerEnter(Collider other)
{

    Destroy(this.gameObject);
}

Where should i put the if statement ? thank you Its c# btw

In your player object, put something like:

public pointCount = 0;

void addPoint(int point){
    pointCount += point;
}

In your OnTriggerEnter in collider, add the line other.gameObject.SendMessage("addPoint", pointNumber);