Can someone please provide detail on how IM (International master) and GM (Grand master) norms are attained?
First you should also know that these titles can also be won via "Direct Title". For instance, in the current World Cup competition all the players who reached the last 16 are entitled to the GM title. Of course they were all already GMs, but other competitions also give the opportunity to win GM and IM titles outright.
GM and IM norms can be obtained either by Direct Title or by performance of the required standard in a tournament which qualifies as a norm event.
For instance if there is a tie for world champion in any of over 65, over 50, under 20 or continental championship then players tieing for first each get a GM norm if they are not already GMs.
For norm tournaments and the standard of play required there is a full description here.
GM norms require a "GM performance" and IM norms require an "IM performance" These are:
GM performance is ≥ 2600 performance against opponents with average rating ≥ 2380.
IM performance is ≥ 2450 performance against opponents with average rating ≥ 2230.
There are complicated rules regarding the length and make-up of the tournament and the players played. For full details see the handbook reference.
Here is a simplified (and so inaccurate) summary:
The player must play at least 9 games
At least two federations other than that of the title applicant must be included
A maximum of 3/5 of the opponents may come from the applicant’s federation and a maximum of 2/3 of the opponents from one federation
At least 50% of the opponents shall be title-holders excluding CM and WCM.
For a GM norm at least 1/3 with a minimum 3 of the opponents must be GMs.
For an IM norm at least 1/3 with a minimum 3 of the opponents must be IMs or GMs.