There are two audible clues that will help you distinguish them. 1) the "hard c" vs. the "hard g", 2) the "d" vs. the "t". Try Google Translate: type in "cadeau" and press the speaker button to hear it pronounced. Listen very carefully. Now try "gâteau". After a few times, you will hear the difference clearly. Sometimes in audio exercises you will be able to pull out words that are less familiar simply by listening carefully.
On this side of the pond (U.S.), we call it a "cookie", on the other side (U.K.), it's called a "biscuit". That is, besides being the common word for "cake", of course. http://www.larousse.com/en/dictionaries/french-english/g%C3%A2teau/36216