There are tools specifically made to decompress quick couplers. Even if you don’t purchase one, the below video should demonstrate what you’re needing to do, whether it’s with a towel and hammer, smacking on a hardwood block, etc.
The other option is to loosen the coupler until it leaks and releases pressure, then retighten and connect. For the female connectors only way I’m aware of to release pressure is loosening the connection until it leaks and retighten. Whatever you do, it should NOT involve having your hands or any other body parts in a position where the hydraulic fluid can be injected into you.
Of course on the tractor side, I’m sure you know you can relieve pressure by shutting down the engine and cycling the associated valve.