The depth of the well is d = 37 feet.
The worm climb up height of 7 feet each day and slides down 2 feet down. So worms climbs by height of,

So worm climb 5 feet up on the well.
Determine the number of days to climb up to the well.

So 7 days require to climb a height of 35 feet for climb of remaining 2 feet one more day is required.
Thus, worm take 8 days to climb the height of 37 feet.