She reached out to grab the magazine on top of the shelf.

Literal

She [topic-は] shelf [genitive-の] top [genitive-の] magazine [object-を] grab-let-me [intent-と] hand [object-を] extended.

~ようとする(/した) is the volitional + と + する frame for 'try to / be about to do X.' Here the volitional 取ろう ('let me grab') feeds into と as a marker of intent; the main verb 手を伸ばす ('reach out one's hand') describes the action taken in service of that intent. 棚の上の雑誌 stacks two の-modifiers: 棚 ('shelf') + の + 上 ('top') + の + 雑誌 ('magazine') — 'the magazine on top of the shelf.' Each の links a possessor or modifier to its head.