First of all . . .
-- You want to know "km / hr", so you know you'll have to divide distance by time.
-- You want "km / hr", so you know the time will have to be in hours.
30 minutes = 1/2 hour
-- Doo da division:
(4 km) / (1/2 hour)
= (4 over 1/2) (km/hr)
= (4 times 2/1) (km/hr)
= 8 km/hr .