How to make counter unity?

How do I count how many diamonds my player has collected in my 3d world

What I need to do is to make a script which will update my text ui when the player collides with a diamond but I do not know how as I auto generate the diamonds

How could I go about writing a script that will update the text score