On my extension ladder, the rope is tied to the bottom rung of the fly section and goes up between the rungs and through the pulley attached to the top rung of the base section. The rope then just hangs down from the pulley when the ladder is in use. When the ladder is in storage, I normally just tie the end of the rope around a pair of rungs of both sections just to keep the rope from being all over the place and the ladder tidy.
When I want to set the ladder up, I untie the rope, set the ladder against the wall (or whatever), then lift the ladder so it's vertical and pull the rope to lift the fly section up the base section to the height I need.
NOW, A SURPRISING NUMBER OF PEOPLE DON'T KNOW HOW TO PROPERLY GET FROM A LADDER ONTO A ROOF OR VICE VERSA.
I often see newbies set up their ladder so that it's only a foot or two above the eve of their house and they risk life and limb getting from the ladder onto the roof or from the roof onto the ladder. The correct and safe way of doing it is to raise the ladder so the top of the ladder is a good 4 or 5 feet above the roof line. Climb the ladder so that you're high enough so that you can step directly from the ladder onto the roof. And when you're going from roof back onto the ladder, you can step from the roof directly onto the ladder without having to do anything dangerous at the top of the ladder. If your ladder isn't long enough to be able to step from roof to ladder and from ladder to roof, then you need a longer ladder.
If a helper is available, you should have someone put their weight on the bottom of the ladder while you are going from ladder to roof or from roof to ladder so that the ladder doesn't move.
Whenever possible, take a bungee cord up the ladder with you to anchor the top of the ladder against whatever is available, like an evestrough or metal flashing around a flat roof or whatever. As far as possible, you want to keep that bungee cord secured on the opposite side of the ladder than the side you're climbing to make sure It doesn't catch on your shoe and cause you to trip.
And, if you put your ladder against the END of a gable roof (rather than anywhere along the eve) always step from the ladder onto the lower part of the roof when getting onto the roof and from the lower part of the roof onto the ladder when getting onto the ladder.
This is all simple stuff, but I see so many people taking dangerous risks because they don't know how to get from roof to ladder and ladder to roof without risking their lives, and it' a shame. Some simple instruction would save these people from taking such dangerous risks.