The cosine function cos(x), as you know, has a peak at x=0, a minimum at x=Ï€, and another peak at x=2Ï€. That is, its period is 2Ï€. Its amplitude is 1, meaning the peak is +1 and the minimum is -1.
Problems where sine or cosine functions are used to model periodic behavior are problems in scaling. You need to match the period and amplitude of your scaled cosine function to the period and amplitude of the phenomenon you are modeling.
Here, high tides are 12 hours apart, so we need to scale x by a factor that turns 12 hours into 2π. That might be x ⇒ 2πx/12 or (π/6)x.
The high tide is 9 ft, and the low tide is 1 ft, so we need to do vertical offset and scaling to make the peak of our transformed cosine function be 9 and its minimum be 1. That difference is 8, so has an amplitude of ±4 around a midline of (9+1)/2 = 5.
Then our tide model is
.. water level = 5 +4*cos((Ï€/6)t)