Namibia is one of the safest countries in Africa to travel, the normal things that are common sense, don't flaunt wealth (jewellery, cameras etc) applies as it does in any country. Travelling at night is fine, although African roads do take some getting used to.
Windhoek is a safe town, although as again with anywhere it does pay to be sensible, don't look like a tourist, know where you are going, don't walk the streets drunk and alone, go into dark unlit areas that you don't know. All these things apply anywhere. carry copies of your passport etc, leave the originals in a safe place, if stopped the copies will be accepted everywhere.