Imagine adding 3 apples and 2 oranges and calling the result "5 apples". There are 5 pieces of fruit, but not 5 apples. Units work the same way: 5 m + 3 s has no sensible answer, because metres measure length and seconds measure time. You can only add or compare amounts of the same kind, such as 5 m + 3 m = 8 m, just as the like terms 5x+3x combine but 5x+3y do not.
Multiplying and dividing are different: they build new units. Speed times time is (m/s) × s, and the seconds cancel, leaving metres. So d=vt with v=12 m/s and t=5 s gives d=60 m, and the units confirm the answer is a distance. You can treat units like algebra letters: sm×s=m, just as ba×b=a.
Matching kinds of quantity is not the same as matching units. 5 m and 30 cm are both lengths, so they can be added, but you must convert first: 5 m + 0.3 m = 5.3 m, not 35 of anything. Dimensional consistency asks whether terms can be added at all; unit conversion then puts them in the same unit so the numbers can be combined.
Think of it like this. Units behave like money at a shop counter. You can add dollars to dollars, and you can change euros into dollars before adding, but "5 dollars plus 3 kilograms" is not a price at all. Multiplying works differently: $2 per kilogram times 3 kilograms gives dollars, because the kilograms cancel.
Core idea. Dimensional consistency requires every term in an equation to carry the same units.