Let's say I have this function $f(t)= 10m \cos(\pi \frac{rad}{s}t)$, how do you treat units of measurement at the time of derivation to get the right units after deriving the formula. Accordingly,
$f'(t)= -10m\sin(\pi\frac{rad}{s}t)\cdot \pi \frac{rad}{s}$ but what happens with $rad$?
So, in general, what are the rules to treat units of measurement when deriving?
As a general rule, if you take the derivative of some function $f$ with respect to some variable $x$, by the definition of the derivative, the units of the derivative will be: $$[f'(x)]=\frac{[f(x+h)]-[f(x)]}{[x+h] - [x]}=\frac{[f(x)]}{[x]}$$
In your specific case, you are assuming that radians are dimensionless, as they are commonly used (though they need not be). Note that trigonometric functions can't be used on dimensional quantities, which is why in your case you must treat radians as a dimensional less quantity here.
To see why this is the case, note that using the Taylor expansion of any trigonometric expression (e.g. $\sin x$) gives a mix of powers: $$\sin(x) = x - \frac{x^3}{3!} + \ldots$$ Since we can't add objects with different dimensions, we can't use trigonometric (or exponential) functions on anything dimensional.