Usually to make a simple PWM (for practice or introduction PWM) of the hobbyist to use some of the circuit made of Op-Amp, which consists of Schmitt Trigger circuit, integrator and comparator.
Schmitt Trigger function that produces a square wave will be converted by the integrator sawtooth wave or commonly also called Ramp, and Ramp compared with a reference voltage that can be changed much voltage. So the result is a PWM output.
Skema Rangkaian Low Side PWM Motor/Light Controller
This circuit can switch a fairly high amount of current, an IRFZ34N MOSFET can handle over 35 Amps if connected to a proper heat sink. Higher power FETs, such as the IRFZ48N or IRF1010Z can be substituted if even larger currents are required. It is also possible to connect multiple FETs in parallel for even more current capacity. Always use thermally conductive grease between the FET and the heat sink, and remember that the heat sink is electrically live.
Inductive loads (motors) may require special care since they can generate large voltage spikes that can damage the MOSFET. Replacing the 1N4002 with a fast recovery diode may help absorb the reverse voltage kick when driving an inductive load such as a motor. If you use these circuits for experiments with electric vehicles, be sure to install a circuit breaker in series with the battery, the circuit breaker should be easy to reach by the driver. This is especially important due to the fact that when MOSFETs fail, they often short out, leaving the motor on at full speed.