Interesting that I just did one of those today. You want to run the wires through the pins with some extra hanging out. You want to position the plug with the pins up. It needs to be secure. The main thing is a hot iron, and that you heat BOTH the wire and the pin. I use a 33 watt pencil iron which is hotter than the typical iron. In order to get the solder to flow down the pin, the pin must be hot enough to melt solder.
I heat the wire and pin together while applying solder to the joint. Touching the iron, wire and pin together. Once the pin is hot enough to melt the solder, I apply enough solder to fill the opening of the pin. Then, remove the heat. The solder will fall down into the pin somewhat. If it falls to far, just repeat the process until you gat the result you want.
Once the wires are soldered, take some side cutters and cut off the excess wire. You can use a wire brush to clean up. If any solder gets onto the outside of the pin, you will have to remove it. A sharp knife or small file. Best to avoid this if possible.
This really takes practice. I have soldered for over 35 years and frankly never thought of trying to describe the process in print. Hope this helps!