How to set a max horizontal speed, 2D platformer

I’m building a platformer demo for a small project and need to implement a max horizontal speed limit in order to fix some issues. I have zero code knowledge so I’m hoping someone here can write out the few lines (I hope) of script needed to achieve this.

I’m basing the demo off the Unity 2D Gamplay tutorial files, and the included character controller already limits vertical movement speed, but I’m unsure how to adapt it to horizontal movement. I’ve found the following lines in the script:

var maxFallSpeed = 20.0;

movement.verticalSpeed = Mathf.Max (movement.verticalSpeed, -movement.maxFallSpeed);

I can make a new variable easy enough (var maxMoveSpeed = 20.0;), but I don’t know how to write a function for it to take effect.
Primarily this need to take effect while in the air, but it doesn’t matter if it takes effect while the player is grounded as well.

not familiar with the tutorial, but if you can find a var that applies to movement speed, you can add a line like:

if(speed > maxMoveSpeed)
speed = maxMoveSpeed;

in the line just before the line implementing the actual movement, which probably looks something like:

controller.SimpleMove(forward * speed);

or maybe:

transform.position = …etc

if this doesn’t do it, try posting the relevant code (that applies the movement)