Raising a Sonic Chao is genuinely tricky—so much so that many players never pull it off. Here's the general method:
1. Hatch a normal egg while playing as Sonic.
2. Raise it using Shadow so that it evolves into a neutral Chao.
3. Once it's a neutral Chao, only enter the garden as Sonic and feed it exclusively green Chaos Drives.
4. Over time, it will grow spikes and change color.
The same idea applies to other Chao types—just swap the characters accordingly. For example, hatch with Knuckles and raise it using Rouge with a focus on Power.