Cuidar, Spanish for “to take care of” or “to be careful” and commonly used in the warning cuidado, comes from the Latin cogitare, “to think”: cogito ergo sum, as they say.
The Latin cogitare comes from the Latin prefix com with agitare, “to turn in the mind” which comes from agere, “to move”. From this we get the English… agitate!
So we have an interesting evolution: from moving to thinking (a moving of the mind) to… being careful. Being careful is then the same thing as being thoughtful — at least in Spanish.
Interestingly, the original root has been mostly lost in the modern cuidar, with the c‑a-g‑t root turning into c‑d. But you can still see the outline at the extremes.