Always take photographs when messing with wires !!!!
That hex pipe, its not got a left hand thread at one end has it?? Try unscrewing from the compressor side. It may be left handed into the receiver, Check with a bolt on the new one if you can.. Holding the hex connector with a spanner/wrench , can you unscrew the part that is attached above it with the pressure switch attached?
Worse case scenario, cut it in half unscrew from the compressor and get a replacement, it will almost certainly be a standard thread which you can buy from the compressor manufacturer.
Lee