If you were "forced to take this subject" then someone thinks you need it. If you do not know why you should find out!
For the first problem, I presume that you know that "\(\displaystyle v= \frac{d}{t}\)" where v= velocity, d= distance traveled, and t= time taken. That is implied by the fact that we write velocity as "km per hour" or "km/h", as a fraction. Multiplying both sides by t, \(\displaystyle tv= d\) and then, dividing both sides by v, \(\displaystyle t= \frac{d}{v}\). I have "solved for t" because the problem gives information about the time: "the total journey takes 45 minutes" (or 3/4 hour).
So, taking d to be the distance from A to B, since he walked at v= 4 km/hr, the time taken is \(\displaystyle \frac{d}{4}\) hours. Walking back from B to A, since he walked at v= 6 km/hr, the time take is \(\displaystyle \frac{d}{6}\) hour. We are told that the total journey took 3/4 hour, we must have \(\displaystyle \frac{d}{4}+ \frac{d}{6}= \frac{3}{4}\). Solve that for t.
For the second, let the father's age, now, be "f". The son is 24 years younger so the son's age is f- 24. In two years, the father's age will be f+ 2 and the son's age will be (f- 24)+ 2= f- 22. The sum of their ages the will be forty: (f+ 2)+ (f- 22)= 40. Solve that equation for f.