start by making a sketch of the situation.

let the harbor be at the origin and let t = 0 be noon

at t = 0 , ship A is at position (-9,0) and is heading south at 8 km/hr ...

its position at any time t is(-9, -8t)

at t = 0, ship B is at position (0, -6) and is heading south at 6 km/hr ...

its position at any time t is(0, -6 - 6t)

use the distance formula to find the distance between the two ships at any time t.