In addition to @Lisa451586 's helpful answer, it is worth noting that:
The 2 forms are virtually interchangeable. It really boils down to personal choice.
(1) The short 안 negation might seems easier to use for English speakers because it can be matched easily to the word 'not'.
The set-back however is when dealing with 하다 verbs, one has to ensure that with action 하다 verbs, 안 has to go between the noun and 하다.
공부하다 -> 공부 안 하다
(2) The long negation –지 않다 (often described as more academic and formal) might look more daunting at first sight but it gets easier with practice.
Its advantage is one rule applies to all verbs (action & descriptive verbs).
Not all -하다 verbs are with nouns. For example, the short negation of 피하다 to avoid is 안 피하다; 피 안 하다 is incorrect as 피 cannot stand alone. Also both 안 사랑하다 to love and 사랑 안 하다 are good whereas neither 안 신중하다 to be considerate nor 신중 안 하다 sounds natural. Different researchers have different opinions on where 안 should go with -하다 verbs, but I believe it is beyond morphology.