This is a summary (with some commentary from my side) on a piece with the same title by Michael Nielsen.
Effective people are self-disciplined. I have been fighting with my lack of self-discipline for as long as I can remember. And for the longest time I treated it as a side-effect of my weak will-power. But over the years, experience has taught me otherwise:
Will power is a finite and a scarce resource. Use it only when you absolutely have to.
Your state of mind and environment have a much bigger and longer lasting impact on your discipline. If both of them are aligned with your goal, things will fall in place naturally and you will not need to discipline yourself. You may have heard people putting in 12 hours a day at work and still having fun.
Your state of mind is affected by having clarity about what you are doing. In terms of the theory of reinforcement learning, having clarity means having a good and confident estimate of the expected future value of doing something. For example, if you are certain that putting in 12 hours a day for a year is going to get you a Nobel prize and you really want one, the 12 hours stop seeming like too much.
The environment includes both your social and physical environment. If your social environment - advisor, lab and fellow researchers support the development of research skills, it can make an enormous difference. Every once in a while you are going to doubt the worth of your work. Having a supportive social environment is critical in these situations.
The last factor is self-honesty. You know yourself the best. This means you are most susceptible to being fooled by yourself. And between you and yourself, there is no one else watching. One way to enforce honesty is to collect hard data about yourself on a regular basis and evaluate that every once in a while. Diary entries, research logs, daily logs are some different ways to do it.