Essentially what you're given is the following
[tex][total gallons for the specified time] = [gallons]*[days]\\[/tex]
The easiest way to approach this problem is to use the given information to find the amount of milk the family consumes over the course of a day.
[tex]\frac{5}{8} = g*3\\\\\frac{5}{8} = 3g\\\\\frac{5}{8 * 3} = g\\\\g = \frac{5}{24}[/tex]
So now that we know that the family drinks [tex]\frac{5}{24}[/tex] gallons of milk each day, we can multiply by the desired amount of days to discover how much milk the family drinks over that period of time.
[tex]g = \frac{5}{24} * days\\g = \frac{5}{24} * 4\\g = \frac{20}{24}\\g = \frac{5}{6}[/tex]
So from this, we now know that the family drinks [tex]\frac{5}{6}[/tex] gallons of milk over the course of 4 days.