You've already seen how to use indefinite articles un or une to express a/an (see Using un, une to say "a" (indefinite articles))
Now look at these negative sentences:
Indefinite articles un and une become de or d' (in front of a vowel or mute h) after a negative expression (ne...pas / ne...jamais / ne...plus ... etc.) in order to express no / any.
This rule does NOT apply to sentences using the verb être and other Verbes d'état, with which the indefinite article doesn't change:
When you want to emphasise the meaning of ONE (un/une) - not just a/an - as in He doesn't have ONE car, but TWO, you will keep un/une in the negative sentence - but here it doesn't mean no/any:
Note that definite articles (le, la, l', les) don't change in negative sentences:
J'aime le chocolat. -> Je n'aime pas le chocolat.