The simplest circuit is to use a LM7824 three-terminal voltage regulator. The power input is connected to the first pin (if the power supply voltage is high, a current limiting resistor needs to be connected in series), the second pin is grounded and the third pin is the power output, 24 volts. If the current is not enough, you can connect a triode to expand the current. (The triode selects PNP power, the emitter is connected to the power supply, the base is connected to the current limiting resistor back end, and the collector is connected to the output).
Other voltage regulating circuits are more complex, such as 2575,15001, etc. to adapt the inductor, you can check the specification data online, and select the corresponding components.