This is a sample from the book "PhD: an uncommon guide to research, writing & PhD life".

Getting through a PhD takes a level of dedication, determination and resilience only possible if you really want to succeed, and there may be times when you have to do absolutely whatever is necessary to get the work done.
Sometime in my third year, work began on a new, multi-million-pound nanoscience centre attached to the physics building. This was very exciting for the department, but meant that the equipment in my lab kept picking up mechanical vibrations from the construction work. There was no other option but to run the experiments at night.
Working a twelve-hour shift is hard, but it’s even harder when you work in an underground optics lab with black-painted walls, with the constant noise of running vacuum-pumps in the background and nobody to talk to but the vending machine. It wasn’t much fun, but it needed to be done.
So you have to commit, but there is one absolutely crucial caveat; the PhD is not everything. Even if you invest all your energy in the process, you must not invest your entire sense of self-worth in the outcome.
If you fail, it is not the worst thing that can happen, and if you pass, it is not the greatest. There are many challenges, successes and failures in life, of which the PhD is just one.
Failing a PhD is no worse than going through a relationship breakup after several years; unpleasant – certainly – and perhaps for a while it might feel devastating, but it happens all the time and people recover.
It is no worse than an athlete training day after day, year after year, shedding blood and sweat and tears, sacrificing everything to become world champion only to lose in the final. Heart-breaking – maybe – but some dreams just don’t come true, even if you give it your best. It doesn’t mean your life is over, and it doesn’t make you a failure. There are always other challenges to take on, other things to achieve. They may be hard to imagine if all you can see right now is your PhD, but they are there if you look for them.
Getting a PhD signifies nothing about your value as a person, and it signifies nothing about your intelligence (I have known a fair few feckless academics). Having a PhD does not guarantee you will find a job, and not getting one doesn’t mean you won’t. The importance of success and the consequences of failure aren’t as great as you might think.