If you want to jump to a specific line number, you can use M-g M-g <number>, or (because C-u also provides numerical arguments) C-u <number> M-g M-g.
Finally, many motion commands set the mark, so you can use C-x C-x to return to where you were and select all text between your previous and current locations.
Oh, and if you want something even better, you can use C-` to jump to the location of compiler error if you use M-x compile, you can use ag.el or helm-ag for ag integration, Ace-Jump, which is similar to EasyMotion, built-in exuberant ctags integration (and a built-in ctags clone, etags), packages for cscope integration (if you're using C), and fiinally semantic, which provides a variety of parser-based tooling if it's supported by your language.
But you can also just use C-n, etc. and we won't judge you for it.