If I have an irregularly shaped magnetic material and want to find which way is the north and south. How do I do it?
And more importantly, why are the north and south poles of a magnet situated where they are?
A typical magnetic material is made up of magnetic domains. These are regions of the material where all the electron spins are aligned to give the domain an overall magnetic moment. Typically these domains will be around 10 microns in size.
The total magnetic field of the chunk of iron, or whatever, is the sum of the individual fields of all the domains within it. In the unmagnetised state the domains are randomly aligned so their fields cancel out. When you magnetise the iron you are changing the alignment of the domains so they are partially aligned. This makes their fields reinforce instead of cancelling so we get an overall macroscopic magnetic field.
So to understand the field of an irregularly shaped piece of iron you need to consider the domains within it and add up their magnetic fields. In effect it's like making up your shape by gluing together lots of tiny bar magnets. An individual magnetic domain has a dipole field and in a bar magnet these fields sum to give a total field that is also approximately dipolar. However for some random shape the total field is going to be more complicated so it can't simply be described as a dipole.
The North and South poles we associate with magnets are the two directions in a dipolar field, so a randomly shaped magnet doesn't necessarily have distinct North and South poles. When you are far enough away from the magnet the field will usually look approximately dipolar, with distinct poles, but as you get closer to the magnet the field will become more complex.
I have written a related answer in What happens to the poles of a bar magnet if it isn't completely broken in two, but only partially broken? and you might be interested to read that as it also talks about irregularly shaped magnets.
The easiest way to determine the polarity of a magnet is to set the magnet on a flat surface so one of its ends is next to a compass. Then, check which end of the compass needle is pointing at the magnet. If it’s the North end, it’s pointing at the South pole of the magnet. If it’s the South end, it’s pointing at the North pole of the magnet. If you don’t have a compass, then you can create one, by finding a string with enough length to tie it around the magnet and suspend it, away from you, and you have to make sure that the magnet can rotate freely. then it will start rotating, When it stops spinning, the end that is pointing North is the North pole of the magnet. but if you will not be able to tie a string around your magnet then, here is the third way, Fill a cup, bowl, or small dish with water, (which is enough amount of Styrofoam to float freely. The Styrofoam should be small enough to place in your water dish and a large enough to hold your magnet, then you put your irregular magnet on the styrofoam, and the part that points north it is the north pole.
For the second question, it can be determined to calculate the Net Dipole Moment of the magnet, which is defined as the vector sum of the magnetic moment of the electron and each other particle which is electrically charged and is in motion. for example, if you have a soloneoid, and there is a current through it in anticlockwise direction then that end of the solenoid behaves as the North Pole and rear end as the South Pole and the reverse.
hope that was helpful.
The answer to Question 1: Just hang the magnet by a thread. After some time, it will align itself w.r.t earth's magnetic field. Part of the magnet which is in the direction of North will be the North - Pole of the magnet.
The Answer to Question 2: It's direction of current or tiny atoms/molecules (their magnetic dipole moments) decides where north and south pole of magnet should be situated. But they will be always in opposite directions.