Once you get the hang of flying your ship when gravity is in play, it's relatively easy to predict the slingshot so you can whip past the sun's gravity before getting sucked into it. But if you're traveling too quickly, there might not be enough time to adjust your heading and you'll get sucked right in.