Hmmm i think you should do this tutorial first but i'll try to help you.
First you need to create a button, then add a script and put this inside
extends Button
func _ready():
connect("pressed",self,"_random")
func _random():
randomize()
set_text(str(round(rand_range(0,10))))
In the ready function you connect the pressed state with the _random function.
randomize() change the seed which will generate the random number.
And the last line set the button text with a random number from 0 to 10.
Hope it helps!