This page of the guide to TES V: Skyrim describes getting through the keep with Ralof as part of the first main quest, called Unbound. The following walkthrough presents only the situation when you decided to work with Ralof, not with Hadvar. While completing the quest, you can also deal with additional objectives.
New main objective: Escape Helgen
New main objective: Loot Gunjar's body
Approach Ralof, so that he can free your hands. In accordance with the received hint, find Gunjar's body (screen above). Examine it and collect, inter alia, an axe and hero's gear. You should of course equip them at once in the inventory screen. While you're at it, I'd suggest you take a look around the room to find a few precious items.
Prepare yourself, as the Imperial Soldiers will appear here soon and you will have to fight them. Especially look out for the Imperial Captain (screen above) and use the fact the enemies will be more occupied with attacking Ralof. Don't forget about being able to lead out heavy attacks and block. Afterwards it would be good to examine the enemies' bodies and make that a habit for the future. You can hope to find more precious items by the captain's body, so take them with you.
Head further following Ralof, choosing the western exit and afterwards going down the stairs onto the lower level. Ignore the tunnel that will collapse before your eyes and enter the nearby room. Here you will have to fight some more Imperial Soldiers (screen above), without any additional difficulties involved.
New optional objective: Search the barrel for potions
In accordance with the received hint, it would be good to examine the barrel marked by the game (screen above), hiding a minor health potion, minor stamina potion and minor magic potion. The same goes for the room, as many valuable items can be found hidden inside it.
After examining the room, approach Ralof to resume going through the Keep. Soon enough you should reach the dungeons, where you should help the Stormcloak soldiers in getting rid of the Torturer (screen above) and his assistant. Afterwards listen to a short conversation and note that you received a dozen Lockpicks.
New optional objective: Attempt to pick the lock to the cage
I'd suggest devoting some time to complete the optional objective connected with opening the cage, even if you don't want to play as a rogue in the further part of the game. Approach the marked cage and interact with the door. Familiarize yourself with the instructions and approach the rather easy mini-game (screen above). You have to turn the lockpick each time and afterwards check if its position lets you perform a full turn of the lock. If you adjust it correctly, the lock will get opened and if you keep on trying to turn the lock in an incorrect position for too long, you will break the lockpick. Luckily, even if it happens that you use up all the lockpicks received from Ralof, you can always find more inside the room you're in. After opening the cage, firstly collect all the items that once belong to the former mage. Apart from that pick up the items lying around him, especially the Spell Tome: Spark. Take a look around the room to find some items useful for the warrior. Open up the other chests and pick up The Book of the Dragonborn as well.
Now head to the corridor going west and after a few moments turn south and use the stairs. Head towards the big hole in the wall. You will come across some more Imperial soldiers after reaching a bigger cave. Be careful, as there will be a rather big group of them to eliminate. Additionally archers will attack you from the southern part of the room (screen above). Try to avoid their attacks and eliminate them in direct combat.
Move on to the west. Wait for Ralof to lower the drawbridge and keep going forward, ignoring the fact that another passage collapsed behind you. After reaching a bigger cave head south and afterwards turn west. Soon you should reach a spot where a group of Frostbite Spiders (screen above) will attack you. Keep moving throughout the whole battle to avoid their poison. Also remember to focus on attacking only one of them at a time. Afterwards don't forget to examine their bodies and collect the precious (and light) Frostbite Venom.
Now head east, eventually reaching a big cave. Stop after Ralof notices a bear. Listen out what he has to say about the possible options. Note that you have received a long bow with twelve Iron Arrows. If you don't intend to attack the bear, crouch and head south-east (screen above). If only you don't approach the beast too close, you shouldn't get attacked.
If you want to get rid of the bear, you will have a wider choice. The most obvious solution is using the bow that you received from Ralof (screen above). You could also take care of him in different ways, for example in direct combat or using magic. Don't forget to check its body afterwards.
Regardless of whether you avoided the bear or fought him, you should soon reach an exit to the surface (screen above). Wait for the game to move to a new location and listen out to what Ralof has to say. The man will suggest heading to the nearby town of Riverwood to meet with his sister, Gerdur.
Main quest unlocked: Before the Storm