Pure numbers like 1, 2, π, etc. always are “lifted” into the algebra as dimensionless.
So to be formal, the dimensional algebra concerns items which are a pair of a real number $\mathbb R$ and seven rational numbers $\mathbb Q^7$.
(At least in SI units. There's no formal reason it had to be seven.)
A constant like the speed of light $c$ is thus the pair $(299~792~458, (0,1,-1,0,0,0,0)).$ Meanwhile the fundamental charge $e$ is the pair $(1.602~176~634\times10^{-19},(0,0,1,0,1,0,0))$.
In terms of algebra, we define that we can add $(r_1,u_1)+(r_2,u_2) = (r_1+r_2, u_1),$ if and only if $u_1=u_2$. This means that $c + e$ is a type error, those numbers did not have the same units and were not eligible to be added. Meanwhile we are much more free to multiply, $(r_1,u_1)\cdot(r_2,u_2) = (r_1\cdot r_2, u_1+u_2),$ and so $c\cdot e$ is fully allowed and is approximately $(4.803~204~71\times10^{-11},(0,1,0,0,1,0,0))$.
Using these definitions, some other things “lift” into the algebra. This just means that those things can be easily defined in a way that works intuitively as if they were their former selves. So the real numbers “lift” as $r \mapsto (r, (0,0,0,0,0,0,0)),$ an easy embedding , and then this is intuitive because with these rules $3c$ is straightforward multiplication while $3+c$ is another type error, and one straightforwardly has things like $c+3c=4c$ without caring much about it.
One useful lift is division, this inherits the problems of division by zero.
Another useful lift is all rational powers, $(r, u)^q = (r^q,q~u).$ However, this cannot be extended to a dimensionful exponent in any easy ways, nor to a real exponent (at least, not without switching from $\mathbb Q^7$ to $\mathbb R^7$). So $\sqrt{c}$ is well-defined but $c^\pi$ and $c^c$ are type errors.
Some other useful constants are:$$\begin{align}\text{kg} &= (1,(1,0,0,0,0,0,0))\\
\text{m} &= (1,(0,1,0,0,0,0,0))\\
\text{s} &= (1,(0,0,1,0,0,0,0))\\
\text{K} &= (1,(0,0,0,1,0,0,0))\\
\text{C} &= (1,(0,0,1,0,1,0,0))\\
\text{mol} &= (1,(0,0,0,0,0,1,0))\\
\text{cd} &= (1,(0,0,0,0,0,0,1)).\\
\end{align}$$ These just make things much easier to read, like $$
\sqrt{c}\approx17314.5 ~~\text{m}^{1/2}/\text{s}^{1/2}.$$
And finally, the thing that you can't lift—the arbitrary function. We have a standard procedure which we use to lift functions to other algebraic domains. So for example $e^M$ where $M$ is a square matrix, we define this using the standard power series of $e^x$, because we have addit and multiplication among square matrices. But because you get a sum of terms (pure number) times $x^n$, and the pure number is dimensionless, the only way to avoid the type error is if $x$ is also dimensionless.
This means that the only arbitrary functions in the dimensional algebra have the form $y=U~f(x_1, x_2, x_3, \dots)$ where $U$ is some multiplication that has the right units ($y=(r_1,q)$ and $U=(r_2, q)$ for the same $q$), and $x_1, \dots$ are all unitless multiplications ($q=(0,\dots,0)$). If you like this can be thought of as the “fundamental theorem of dimensional analysis,” you write out all of the dimensional constants and initial conditions that could possibly pertain to the problem, you write out all of the dimensionless constants you can make with them $x_1, \dots$, and then when you run into a problem that requires a force as its answer, say, you use any combination of dimensional constants to get a force $(1,1,-2,0,0,0,0)$ and multiply by an arbitrary function of the $x_i,$ this is the most general possible expression. This procedure thereby non-dimensionalizes the problem, you have $y/U$ as a pure number and the $x_i$s as pure numbers.