Probably the best way to do this is with an Op Amp–like this:
Caveats:
Those resistor values might need to be different, depending on the application.
This assumes a frequency less than, probably around 500kHz.
The Op Amp supply voltage needs to be at least 1.5 to 1.75V higher than 5V [depending on how much current the Op Amp output needs to deliver [up to 5mA]. I indicated 12V, but it doesn’t need to be that high – but, the Op Amp will perform better at higher voltages [only a concern if you plan to push it to it’s limits]. I would use a voltage of at least 7V
The Op Amp of choice must include Ground in it’s Common-Mode Input Voltage Range.
The 0 - 5V to 0 - 3.3V case can be, in some cases, merely the voltage divider [i.e. R1 & R2]. The Op Amp provides buffering. And, buffering makes it possible to connect it to a lower impedance load, without the voltage sagging.
wvmarle:
Very simple: use a voltage divider. 10K + 5k1 will do great.
How can you be sure? The OP has given us no particulars. If the 0-3V must drive a low impedance, this load may alter the voltage levels on your voltage divider.
That's why I included a buffer on the output of the voltage divider, with a note qualifying it as optional, and indicating the possible inadequacy or even that. In fact, some sort of Power Amplifier may be needed--who knows?!