A letter with Shaddah contains two of the same letter, the first of it carrying a sukun (ﹿ) while the second has a vowel sign. The first letter is then merged into the second so they both are pronounced as one with a shaddah (ﹽ).
As for ن and م that have a shaddah, they both have a common rule and it is the pronounce the ghunnah (nasal sound) for two counts. It requires completely closing off the point of articulation of both letters when pronouncing them, and it is the most complete and strongest type of ghunnah there is.
Examples are: الجنة والناس - عم يتساءلون - إن للمتقين مفازا - ثم كلا سيعلمون