The dictionary will tell you whether to treat a compound word as a hyphenated compound (water-repellent), one word (waterproof), or two words (water table). If the compound word is not in the dictionary, treat it as two words.
It’s a good idea to check a current dictionary because the use of hyphens for compound words is changing as the English language evolves.
Exercises:
The hyphen 1
The hyphen 2