If something is mandatory, then it is required by law.
It’s mandatory that everyone be at least 16 to drive a car in the US.
Example picture