Becoming a successful cash game player means being a professional banker: you absolutely must take your bankroll seriously.
Even though many people have side jobs to help support their bankroll, making sure you have enough money for the game at hand is crucial.
This is especially important for cash games because the swings can become so high a small bankroll won't be able to handle them.
For instance, in a No-Limit game, you want to call pairs and A-x suited on small raises so that when you do hit a hand you can potentially get their all-in or close to it.
Without a bankroll, there's no way you can call any raises with less than premium holdings - you'll be playing scared and scared money never wins. Also, if cards are running dry, the blinds will take a toll on your bankroll.
The general rule that most good players follow when playing a cash game is that you need at least 10 chances to win an all-in on a cash table, meaning that you must have a bankroll that can handle at least 10 buy-ins before even thinking about sitting down to play.
Most of the time, I keep a bankroll that gives me at least 30 buy-ins, to ensure that I never go bust.
In Limit games, the general rule is to have 200 to 300 times the big bet. The swings in Limit play aren't as bad, and more than likely they're swings from hand-to-hand rather than from your bankroll.
This means your bankroll won't take as big a hit as in No-Limit, but it also means you have to play longer and more consistently to come out ahead.
Again, a solid bankroll can help you play consistently because you'll be able to stay calm when you take bad beats or go through a rough patch of bad cards, and you won't have to worry about your money.
There is really no one answer regarding the best way to manage a bankroll, but these general guidelines should provide you with a foundation that will help you on your path to poker success.