The letter c makes two sounds—the /k/ sound and the /s/ sound. The sound of c is controlled by the letter following it. When c is followed by a consonant (except h), it makes the /k/ sound. When followed by the vowels a, o, or u, it also makes the /k/ sound. However, when followed by the vowels e, i, or y, it makes the /s/ sound. When c makes the /k/ sound, that is called its hard sound, and when it makes the /s/ sound, that is called its soft sound.
The letter g is similar, sometimes making its hard sound /g/, and other times making its soft sound /j/. However, it doesn't follow the rule as often as c. Some notable exceptions include give, get, gear, girl, and gill.
Spelling With C
When c is followed by e, i or y, it says /s/ as in cent. Otherwise, it says /k/ as in cat.
Spelling With G
When g is followed by i, e or y, it says /j/ as in gym. Otherwise, it says /g/ as in gold.