The quantity given was 10 m/s and they wanted to know what that quantity would be if it were converted into km/hr. Notice that the same units are placed diagonally from each other, so they cancel out each other when multiplied.
Using cubed and square unit is a similar process, just a little more complicated. For example, we are going to convert 56 in^3 to cm^3.
56 in^3 x (2.54cm/1in)^3 = 920 cm^3