Connectors are everywhere, but however they doesn't fit in any position thats why they are so annoying, imagine that you just throw away a wire to connect it , life will be much simplified
so let's understand how they works
Step 1: How It Works ?
Every Magnet has two poles , north and south same poles repel and different poles attract each other
This force can be used to connect different wires with right polarity
you can see demonstration of this connector here
Step 2: Let's Build This !
solder each pole of magnet facing currusponding faces as shown in figure,Negative battery terminal is connected to south pole ,so you need to connect north pole facing on top to negative output terminal.
similarly for positive pole at the receiving end south pole faces outwards and at battery north pole so as they are oposit poles they attract each other.
Step 3: Be Careful !!!
1.As you conected opposite poles oneach sides ,there's higher chances of short circuiting battery, so ensure that magnets are attached properly
2.Avoid placing metalic objects nearby, it can easily catch fire if shorted leads of battery, put ferrite material on battery magnets when you do not useing this connector.