Paul Graham just published his latest essay and it is a recipe for "how to do great work." I highly recommend it, but you should know two things: (1) it assumes that you're "very ambitious" and (2) it's quite long. It's possibly his longest essay.
However, this second feature acts as a kind of filter. Because if you do actually make it to the end, his assumption is that it says something about both your level of ambition and your overall commitment to doing great work. You are presumably not the majority.
As I read through it (albeit relatively quickly), I immediately started copying and pasting excerpts that resonated with me. Eventually I stopped this because there were just too many of them. But as a preview, here are some of the ones that I did pull out:
Four steps: choose a field, learn enough to get to the frontier, notice gaps, explore promising ones. This is how practically everyone who's done great work has done it, from painters to physicists.
Develop a habit of working on your own projects. Don't let "work" mean something other people tell you to do. If you do manage to do great work one day, it will probably be on a project of your own. It may be within some bigger project, but you'll be driving your part of it.