See the course notes. The basic form of the name is Castell-nedd. Welsh has a system of initial consonant mutations. One if those is a nasal mutation caused by yn when it is used as a preposition meaning 'in' or 'at' - an initial letter c- changes to the two letters ngh-. Also, in front of a word starting the letter ng-, yn becomes yng to match the sound:
- yn + Castell-nedd => yng Nghastell-nedd
A mutation is not usually applied to a word unless the reason for the mutation is present, though. In this case, Nghastell-nedd would not be used on its own without the yng.
The various mutations arr explained in the course notes for the sections of the course where they are first introduced.