- The bear is dangerous, you had better not come near it.
- The bear is dangerous, you had better not to come near it.
Aside from the oddity of using diacritical marks in English, the first sentence is grammatical whereas the second is not.
"Had better not" is an idiomatic phrase that acts like a "modal verb" synonymous with "ought not." The complement of a modal verb is a bare infinitive. Therefor "to come" is wrong grammatically whereas "come" is correct grammatically. Idiomatically, however, "go" is more natural than "come" because it implies intentionality.
I want to thank all the commenters for making me see that my original explanation for why the second sentence was wrong was just plain silly.