Desigining something like that yourself from scratch is NOT simple. But, you can buy a step-up voltage regulator chip and build the manufacturer’s recommended circuit. Unless you are a chip designer, that’s how it’s usually done. (Before those special chips were introduced, switching regulators were complicated and expensive.)
In this kind of circuit, the MOSFET is “just a switch”. (You could also use a transistor.) The “trick” is the inductor which stores the energy, and switching the current through the inductor on & off precisely (usually at a high frequency) with feedback to maintain a constant voltage.
When you run current through an inductor, the magnetic field builds-up. When you remove the power source, the magnetic field collapses and the coil generates electricity. If there’s a (relatively) high resistance load connected when the coil is generating/releasing energy, you’ll get high voltage and low current. The hard part is keeping all of this under control… You usually don’t want a “high” voltage.
If you’ve ever seen one of those “pranks” that uses a small battery to shock someone, those use a coil (inductor). The spark plug coil in your car works the same way to generate thousands of volts from a 12V battery.