The c in pencil makes an /s/ sound because it comes before the letter i.
The soft-c rule
In many English words, c has a soft sound—like /s/—when it comes before e, i, or y.
- c + e: cent
- c + i: pencil
- c + y: cycle
Before other letters, c often has a hard /k/ sound, as in cat or cup. So in pencil, the i helps signal that the c should sound like /s/.