My criteria when deciding to work on a project:
Long-term: I must be not just willing, but excited to spend 10+ years of my life on it. People who really change the world do so by working on a very small number of large, long-term projects.
Unique Impact: If I didn't help make it happen, it wouldn't happen (for the foreseeable future), or for some reason I can do it radically better than others.
Economic desperation is the only valid excuse for partially deviating from this formula.
Other criteria I use: https://tryingtobeawesome.com/advice/.