How can I prevent neurosyphilis?

Protect yourself. Always make certain condoms are used and you won't get syphilis.
Avoid syphilis. Neurosyphilis is a bad complication of inadequately or non-treated syphilis which is caught from multiple variations of sexual activity. Therefore, be careful in partner selection, and be very protective, as syphilis, these days, is marching back, especially in gay male populations.