There are ten digits: 0, 1, 2, 3, 4, 5, 6, 7, 8, and 9.
The probabiliy of guessing the first digit correctly is 1 in 10, or 1/10.
That is also the probability of guessing the second digit correctly, and also the third digit correctly, and also the last digit correctly.
Since you must get the first digit correct AND the second digit correct AND the third digit correct AND the last digit correct, multiply 1/10 x 1/10 x 1/10 x 1/10 to get 1/10000.
(You multiply when you have 'and' and when the different parts are independent. In this case, the different parts are independent because guessing the first digit correctly does not affect guessing the second digit correctly, etc.)
Or, another way: there are 10000 numbers starting with 0000 and 9999. Guessing any one of these 10000 numbers correctly is 1/10000.