or you can highlight the code you want to extract,...
# getting-started
p
or you can highlight the code you want to extract, right click, select refactor->extract->variable