Some of the best advice that I've received in my career is that whatever job position you find yourself in, you should always be trying to work yourself out of a job.
In a nutshell, working yourself out of a job means building up your team in such a way that someday you could walk away from your project and everything would continue running normally without a hitch. In order to do this you must invest greatly in your team. You must push and inspire them to grow and improve their skill set. You must keep them from becoming demotivated and complacent.
In the process of working yourself out of a job, you also need to focus on working yourself into the next job. Now, this isn't a cheap way of suggesting that you should always be looking for promotions and more money. The idea here is to simultaneously delegate away some responsibilities in order to take on additional more important ones. In other words, trade-up for tasks that provide more value or have more visibility. Sometimes, this means taking on tasks that nobody else wants to do but it's the only way to ensure you are positioning yourself for the future and aren't simply training your replacement.
Working yourself out of a job is challenging. It takes you out of your comfort zone and leaves you vulnerable. However, the potential rewards are well worth the risk. If you don't agree with me, just consider the alternative approach of living in a world of job protection and CYA tactics year after year.
You can get started today by delegating a task to a team member that is clamoring for some additional responsibility, recommending a good book, offering a colleague some helpful advice, or giving constructive feedback.
Think about it.