One needs to have clear expectations going into the PhD about what they are trying to do and they need to have clear communication with their advisor.
The vast majority of PhDs in science and engineering do very well and find jobs, but most don't get professorships at research focused institutions. Having realistic expectations is key, but a career in research is great.
A PhD is stressful and takes 5-6 years, but it can be a great experience with the correct expectations and a solid plan. The main problem is that most PhD students don't seem to think about those things nearly enough and have unreasonable expectations.