You need to setup two simultaneous equations to solve for the multiple variables in the problem. The variables are: the time spent on the bus, the time spent on foot and the distance traveled each way. The basic formula for motion like this is , which means distance equals rate times time. I'll get you started.
Let's look at the bus scenario. You travel some number of kilometers for some amount of hours at a rate of 48 km/hr. Put another way .
Now look at the on foot scenario. Same idea except you travel at a different rate and time. So .
The times are different but the distances are equal and you can set them equal to each other. The other key is that the total time of movement was 24 hours - 2 hours for rest = 22 hours. So we also know that
Hope that gets you to the solution.