I've seen the structures not to be afraid and to not be afraid. Are they both correct?
I agree with Raymott: both are used, but the first one (not to be) is considered more accurate grammar-wise because the adverb 'not' modifies the entire verb 'to be'.
As for why speakers use the second one (to not be), and the reason it is becoming more acceptable, has to do with semantics. The infinitive marker to, in to be, for example, lacks semantic content, so speakers are starting to place the adverb directly before the semantic-carrying part of the infinitive verb, the base verb, like so,