Stroke the needle approximately 40 times with the bar magnet to magnetize it. Work from eye to point in one direction; don't rub back and forth.
Slice a 1/4-inch thick circle off the cork with a craft knife. Place it on a flat surface and push the needle through the side of the cork so the eye and point extends equally from opposite sides of the circle.
Fill the glass half full with water and float the pierced cork circle on top and you have a simple handmade compass. Placed on a flat surface and away from metal objects, the needle will adjust to point to the closest magnetic pole, north or south depending on your location.