How to move objects with certain numbers,

I wish to make objects move with random numbers like backgammon.
How can I do that?
Is there a video teaching that,

You mean like a dice? or just random numbers on click some button.
If the last is the case you can use RandomInRange(1,6)

I mean like a dice, and How to return an object to the last place of it if it was a wrong move?