Character-by-character: 碳 (carbon) + 水 (water) + 化合物 (compound) = 'carbon-water compound'. This mirrors the chemical formula Cn(H2O)n - carbohydrates are literally hydrates of carbon. A rare case where the technical Chinese term is a clearer description than the English.
register
In casual fitness/diet talk the clipped form 碳水 (tànshuǐ) dominates. Use the full 碳水化合物 in formal/medical writing.