Approach with short hopped fastfalled fair and dsmash/dtilt after falling. Use your airjumps outside the stage to gimp sonic using dair, you can also upB them outside the stage if they're don't expect it. If they do expect it, wait for the airdodge and keep downairing them.
Put a fair in front of sonic and it'll stop him. It's good to dash into your opponent and fair at him when you're at a comfortable distance. He can't even dash>shield>grab you, because his grab is way too bad for it to be able to reach you if you move a bit backwards when your fair gets shielded.
I think tornado beats sonic's B moves, so you can also stop it with that.
Downtilt to grab works, as does downtilt to forward air (to keep the pressure on).
You should be more specific about the sonic players you play against, because people play different. State by what means do Sonic players give you trouble because it could be anything. If you can't shorthop consistently or attack out of your shield, then you should better yourself before you start finding out how to best others. If you actually know how to do the basic stuff, then people can help you.