Probability is tricky to solve. The best way to visualize this problem is to know first your sample space. There are 2 cubes labelled until 6 and they are rolled together. There are 36 outcomes (6 x 6) or simply think about it (1 of one dice can be paired with 6, then so on).
We are looking for the probability that same number are rolled together: (1,1), (2,2), (3,3), (4,4), (5,5), (6,6)
There is only 6 out of 36 outcomes.
Probability is 6/36 or 1/6.