The idea is also that pressing the power button will also help discharge some capacitors as the power-supply tries to supply power. Not sure to which degree this works to make things safer, but trying it won't hurt.
(Note this will _not_ make a powersupply safe to open up)
On a dumb device where the power button is part of the actual circuit, let’s say an old radio this will work.
On a PC, the power button isn’t hooked to anything but the chipset or some micro or an upstream circuit that tries to start a micro. Which means to have any effect, that processor needs to be executing code, or needs to have enough power to start the chipset itself. Both of these are unlikely to have any effect on CPU capacitors or caps in the power supply.
I’m fairly certain this is placebo at best on a modern PC.
It definitely kicks the power light on for a bit under a second on my 2010 era desktop. The (high end, low wattage) power supply is delivering enough voltage to keep the motherboard power controller up.
I have no idea if it discharges all the different voltage rails. I don't like having the fans try to spin up while I'm mucking about, and it stops that from happening.
Of course, from an equipment damage perspective, grounding yourself to the case ground is much more important than discharing the PSU capacitors.
I usually physically unplug the computer, push the power button, then open / touch the case (I'm in a humid climate).
I've never had an issue (ignorging fires, but those happened when the computers were intentionally energized).
(Note this will _not_ make a powersupply safe to open up)