Understood. Please drive carefully.

Literal

Understood. Carefully drive please.

分かりました is the polite past of 分かる, used as an acknowledgment: 'understood/got it.' 気をつけて is a set phrase meaning 'be careful' — literally 'attach your attention.' A practical pair of sentences.