At x=0, the function value is at its middle value and is increasing. That means we can use a sine function with no horizontal shift.
a is the amplitude;
the period is 360/b (assuming x is in degrees);
the horizontal shift is c (0 in this example);
d is the vertical shift (axis, or center line)
The center line is halfway between the minimum and maximum values; in this example the minimum and maximum values are 0 and 4. That gives you the value of d.
The amplitude a is half the difference between the minimum and maximum values.
We already noted that because we are using a sine function the horizontal shift is 0.
The period is 180 degrees; that gives you the value of b.
You now have all the parameters required to write the function.