Did you find more wire-nuts (or wire-crimp-joiners) besides the one in your photo?
These are handy for re-assembly. Otherwise it's up to you whether to solder wires.
By conventional color-coding it's a good bet the two black wires are supposed to join. (In the USA black designates live mains AC.)
Expose 1/2 inch of yellow wire. Most likely it connects to the white wire.
I can't be sure where the loose grey wire goes. One of our expert members may know whether it's for power factor correction or to assist motor start.