Difference between "OnPointerClick" and "OnPointerUp".

I tested both methods and found that they do the same thing: both methods are called when I release the pressed mouse button. So what difference they have if basically do same?

There is an important difference between those functions.

OnPointerUp does exactly what it says. It will be triggered when the pointer comes up, regardless of the mouse position when that happens. The mouse may have left your button when it comes up. You can effectively mouse down on a button, drag off the button and then release and your PointerUp will still fire. Generally it is not good user experience to fire your button events on this one because a user is locked in as soon as the button goes down and cannot cancel the input even if they hold the mouse button down.

OnPointerClick will only occur if the mouse down and mouse up both occur on the button. This is the best place to put your button behaviour.

Well OnPointerClick is does the button go down and come up again and OnPointerUp is did the pointer go up. Largely similar but what if you want you button to flash if OnPointerDown and the take action with OnPointerUp?

If the pointer is down and you move to another button then they act differently but that just gives you more options for how to interact with buttons.

Fairly general question though - unless you have a specific issue probably better asked in the forum.