Hi Alejandro,
Those instructions seem out of date, math has been superseded by wolframscript unless you are running a pretty old version of Mathematica.
Open a shell (Terminal or iTerm on MacOS, cmd on Windows) and type math. If you see something like
Wolfram Language 12.3.1 Engine for Mac OS X ARM (64-bit) Copyright
1988-2021 Wolfram Research, Inc.
In
then it should work.
If you do not see that output, try wolframscript. If that works you will need to create an alias so math is equivalent to wolframscript. How to do that depends on what OS you are running.
Note: I know nothing about SageMath.