Hello I'm stuck on a particular 'genre' of sorts of speed/distance/time questions where you have to incorporate two objects travelling.

Apart from trial and error I don't know how to do these.

For example:

A car travelling at 90km/h is 500m behind another car travelling at 70km/h in the same direction. How long will it take the first car to catch the second?

or

A train of length 180m approaches a tunnel of length 620m. How long will it take the train to pass completely through the tunnel at a speed of 54km/h?

I have several of these questions so I would please like a method...

I've tried different tactics but I can't seem to figure out how to do these type of questions.

Please help.