Ah yes, it seems I was too hasty with my original post. I would still definitely recommend that you avoid using "to" + "not" + "infinitive" in formal situations though.
"How not to get hit by cars" sounds ambiguous because it is naturally split up into "How not to...." and "...get hit by cars". This implies there is a right way and a wrong way to get hit by cars, and that this article will tell you the wrong way. As another example, if the article was called "How not to [....] buy a house", you would assume it was going to tell you what the wrong way of buying a house was. On the other hand, an article entitled "How to not [....] buy a house" sounds like it will teach you how to avoid buying a house!