Avoid baking soda as much as you can. While it might be good for many things, it starts to remove the enamel from the teeth resulting in yellowness.
Avoid fruits and other foods that have dark color pigmentation. Food items like soy sauce, marinara sauce etc have dark pigmentation that can stain your teeth.
Avoid drinking those much marketed energy drinks. They are not as good as they tell you, especially for your teeth. The acids they contain have eroding effects which can remove the whitening from your teeth.
Keep your toothbrush updated. Replacing your toothbrush every three months is a good idea. Or any time you feel your brush looks worn-out, make sure you get a new one. Get a good quality toothbrush.
Keep your tongue clean. Cleaning your tongue is not only about having fresh breath, but also keeping away bacteria that can cause discoloration.
Eating fruits is a good idea for retaining the whiteness of your teeth. It is said that eating fruits helps in cleaning the teeth and also keep them healthy.
Rinse your teeth every time after eating citrus fruits like lemon, oranges and limes as they contain acid that erodes enamel.