It's not particularly hard. Just never accept a leadership position :). As long as you keep your technical skills sharp, you should never be short of a job. However your income will likely plateau very early in your career. You can try to become famous as a way to counteract that, but it is substantially harder than just going into leadership.