When it comes to most things, prevention is always preferable to cure, as is the case for sensitive teeth.
One cause of sensitivity is gum damage. Our gums cover the root tips of our teeth and protect them. When the gums tear away, the root tips are exposed. The root tips contain small tubules that lead directly to the nerves of the teeth. This is why hot or cold drinks become painful when one has sensitive teeth.
To prevent painful bouts with sensitive teeth, brush lightly, with less force. It is a common misperception that forceful brushing will clean teeth more effectively. What it actually does is tear at the gums.
An alternative to brushing lightly is to use an electric toothbrush.
The bottom line is simply this: developing healthy dental habits can help prevent teeth sensitivity later on, as well as keeping your teeth and gums healthy.