1. Form and meaning
The position of nicht depends on what you want to negate or contrast. It often appears before the element being negated, or before a final participle/infinitive when negating the predicate. Brauchen … nicht zu expresses lack of necessity. With separable verbs, zu goes between prefix and verb: anzurufen.
When you study this pattern, identify its communicative purpose first. Then check the verb form, case and word order. German clauses are easier to control when you learn the connector together with the sentence pattern it requires.