So if making a compass with a battery, a needle and a coil of insulated wire and you want the sharp pointy end of the needle to point north, then from this diagram;



you would put the sharp pointy end of the needle, pointing in the direction of the coil attached to the positive terminal on the battery.