To avoid dehydration, drink before, during and after a workout, and regularly throughout the day. It is also important to prevent excessive water loss through sweat by wearing appropriate clothing for the climate and not working out in very high temperatures.
Good hydration is important not only for overall health, but also for performance in sport. Many people underestimate their fluid requirements and are constantly dehydrated. When you are well hydrated your heart does not have to work so hard to pump blood around the body, so nutrients and oxygen that are required to feed the muscles whilst working out can be transported with less effort.
This means it is a lot easier to exercise hard when you are hydrated well and maintain this level of hydration as you work out.