I am designing a robot and my motors are taking up too much current when the robot runs into a wall or has the motors forcefully stopped. How do I limit the amount of current I give the motors?
The situation you are describing is the "stall current" of the motor. It is the amount of current the motor draws when it cannot rotate. High current here is normal, but does no work.
Rather than trying to limit the current, why not use a microcontroller to detect the high current condition and stop applying power to the motor that is locked? This can prolong the life of the motor by avoiding the heat buildup that comes from running at such high current.
There are a variety of ways to sense the current, the simplest way would be to place low value (0.1 ohm) a resistor in series with the motor. Then the microcontroller could measure the voltage drop across the resistor. As the motor draws more current the voltage drop increases. When a threshold is crossed, the microcontroller can stop applying power for a period of time.
A "smart" solution Eric Urban is suggesting would be better, but as a simple hack you can just use a current source, which will do what you are asking for: limit the current. At lighter (normal) loads there will still be a certain voltage drop, so you'll be wasting some power. You can use a FET. Some of them are specifically optimized for that purpose, but I can't make any specific suggestions, since I don't know the current levels you are dealing with. If you can find the right part, the voltage drop under "high normal" load can be kept on the order of 0.5 - 1 V. With a BJT current source you can make it about 1 V but will need a few extra parts. Make sure you use a flyback diode.