I don't think you can't, but you have to be aware of the demands graduate school makes on students, including working long hours on course work first and then actual research. If you are older with more commitments, it's just harder to commit to. It can also be pretty isolating, especially given that most of your fellow graduate students will be a bit younger than you (as well as being quite immature, as many have never had an actual career and come straight from college). By the way, what I've explained isn't great, it's terrible, but it's the system that exists now.
Of course, this is just a warning, just be aware of what you're getting into.
I should add, professors who advise you to go to graduate school have a financial incentive for you to go to grad school if either 1) you will be their students (you are a means for them to get grant money and it helps inflate their credentials, not to mention you will be their cheap labor) or 2) they are currently your professor in undergrad or taught you previously (you going to graduate school also helps up their credentials).
Even barring these possibilities, professors who have tenure or tenure track positions just by virtue of statistics are extremely lucky: many smart people write their theses and do substantial work, but there are a small number of actual positions relative to the number of PhD's awarded. For example, in Physics, I think there are may be dozens of openings in the US every year while there are thousands of newly minted PhD's per year, and the majority of good positions as you can imagine go to graduates from a handful (O(1) number) of schools, anything below the top 10 is significantly less well poised for tenure track professorships. Thus, you have to take a professor's advice with a grain of salt, for they're potentially influenced by survivorship bias.
Of course, this is just a warning, just be aware of what you're getting into.