。
You have to be careful when you're carrying a friend.
Literal
Friend [object-を] carry time-[at-には] pay-attention-must.
An odd-sounding sentence — literally 'when carrying a friend.' 運ぶ ('to carry, transport') typically takes inanimate objects, so pairing it with 友達 is unusual; the intended meaning is probably 'giving a friend a ride' or 'transporting a friend somehow.' It might even be a typo for 友達を選ぶ ('choose friends'). The grammar itself is unobjectionable: ときには topicalizes the time-clause and 気をつけなければならない issues an obligation.