Sand the uneven or water-damaged surfaces with 180 grit sandpaper. Sand in straight strokes along the grain, rather than across it because crossing the grain will show through any stains or varnishes you apply to the finished piece.
Sand over the same areas, once more, with 220 grit sandpaper for a smoother finish.
Wipe the entire piece thoroughly with a tack cloth to remove all of the sanding dust. Go over it several times to ensure that you remove all of it. Even the smallest speck of dust will show through your finish and layers of even fine dust can prevent stains and varnishes from adhering to the surface.