adverb
BAD : He told me to not spend too long in the sun.
GOOD : He told me not to spend too long in the sun.
◆◆◆
Not and never usually go immediatley in front of a to infinitive:
'Try not to worry about anything.' 'It's hard not to feel sorry for him.'