explain how to write 20 miles divided by 4 hours as a unit rate

If that's distance traveled per unit of time it would be

20miles per 4 hrs but since it's usually compared per hour...

20/4= 5 miles

so every hour you travel 5 miles
and thus...

5miles per hour

Note the formula for such a question is....

distance = rate * time

d = rt
so....

rate = distance / time

r = d/t