For the 5V, connect directly.
For 3V and 4V, a linear LDO regulator for each one. Assuming they’re low current, linear would be fine.
The LDO (low drop-out) part is important. The regulator 'overhead' (or drop-out) voltage, needs to be less than the required Vin - Vout, with your worst case (lowest) Vin.
Why LDOs?
tl; dr version: the required overhead (drop-out) between Vin (5V) and the two Vout (4V, 3V) is too low to be satisfied by a non-LDO regulator like an LM317.
Analysis
Assuming +/-10% on your 5V supply, your lowest Vin will be 4.5V. Then, the maximum overhead allowed for each of your supplies is:
- 4V supply: 4.5V - 4V = 0.5V
- 3V (3.3?) supply: 4.5V - 3V = 1.5V
Neither of these can be satisfied by a non LDO regulator like the LM317, which has an overhead (drop-out) voltage of 3V. That won't work for this setup.
So you need LDOs. These have overhead (drop-out) of about 150 - 200mV, lower than your required overhead. More about those here: https://www.analog.com/en/analog-dialogue/articles/understand-ldo-concepts.html
@
and the username. To work correctly, the username (with no spaces, if multiple words) must immediately follow the@
. On a desktop browser, you will be offered a choice of usernames after typing@
and the first letter. (b) Are you really sure that you need those specific voltages? They are unusual and might point to an X-Y problem, but without a schematic and more details, we can't validate for you. Please add a schematic, if you want readers to check. Thanks. \$\endgroup\$