What are units (like meters $m$, seconds $s$, kilogram $kg$, …) from a mathematical point of view?
I've made the observation that units "behave like numbers". For example, we can divide them (as in $m/s$, which is a unit of speed), and also square them (the unit of acceleration is $\frac{m}{s^2}$). In addition to that, we can cancel units: $$s = v\cdot t$$ If for example $v=4\frac{m}{s}$ and $t=5s$, then $$\require{cancel}s=4\frac{m}{\cancel s}\cdot 5\cancel s=20m.$$
Note that $\frac{m}{s}$ can also be written as $ms^{-1}$. This is another example where units "behave" like numbers.
So why can we cancel units, why do units behave like numbers?
I want to get an answer that can be understood by highschool students.
Suppose that there is a set of really natural units: a truly fundamental amount of length that we could count all lengths in, a fundamental amount of time, a fundamental amount of electric charge and so forth -- "God's units", if you will. Then every quantity in physics would just be unitless, and there would be no need for keeping track of them.
Unfortunately, different gods favor different sizes of the fundamental units, so if we buy a set of instruments that show results in Zeus units, the numbers we get wouldn't agree with another set of instruments that use Odinn units. But we want to write down our formulas and measurements such that we don't need to redo everything just because we switch instruments.
Now, algebra to the rescue! We know how to make letters stand for yet-undetermined numbers, so let us decide to use, for example
Now, when we say that, for example, a certain distance is $1.435m$ what we mean is "I don't know what your instrument will show when you measure this length, but I do know that it will be $1.435$ times the $m$ that works for your set of instruments".
In this way, the letters $m$, $s$, $C$ and so forth can be thought of as standing for actual numbers that we might multiply the numeric parts of the measurements by. As such, they follow the same algebraic rules as any other algebraic unknown does -- in particular they can cancel.
What makes this work is the implicit assumption that our unit systems are at least coherent -- so the if the Zeus instruments measure speeds in Zeus-lengths per Zeus-time, so the Odinn instruments had better measure speeds in Odinn-lengths per Odinn-time rather than in some completely unrelated unit that has nothing to do with the size of an Odinn-length.