Simply aim your staff at a tree or boulder and hold [LMB] to begin casting the draining spell. The spell excels at extracting magic energy, but can also harvest limited quantities of other resources.
As explained in the quest, hold down your left mouse button (LMB) while pointing your staff at resource. Be mindful it does hurt creatures, albeit with relatively low damage. Don't point this at NPC townsfolk.