If you mean Sonic the Hedgehog proper, it's Sonic the Hedgehog (2006) on PS3 and Xbox 360 — specifically during the final story, when Sonic is killed and later revived.
It's the most famous instance, and given how that game is remembered overall, it's rarely cited as a high point. Other titles have teased his death in dream sequences or alternate endings, but the 2006 game is the one where it actually happens.