All grammarA1
kein or nicht
The rule
Use kein for a noun that has no article or has ein, and use nicht for the rest, such as verbs, adjectives and gern.
kein takes the same ending as ein: eine Tüte, so keine Tüte; einen Kaffee, so keinen Kaffee.
nicht goes before an adjective (nicht teuer) and before gern (nicht gern).
Examples
Ich brauche keine Tüte.
I don't need a bag.
Ich möchte keinen Kaffee.
I don't want any coffee.
Das ist nicht teuer.
That isn't expensive.
Tom isst nicht gern Tomaten.
Tom doesn't like tomatoes.