It is a balancing act and requires dedication and patience. You need to make some decisions on what things are most important to you and then work towards achieving them. Having the best of both worlds is the end game but the path you take to try to get there will require give and take.
e.g. You may find you have a job that gives you satisfaction and the challenge you need, you also have a nice wife/husband. Suddenly you get a damn good opportunity for a promotion (in reality you don't actually need it - but that extra pay would be great) so you now need to make a decision.
This kind of situations will arise and you need to be able to handle them so that you can maintain the best of both worlds.
Assume for a moment you go for that increased pay and more responsibility, this may increase the amount of time you spend working at a detriment to your family life and other commitments - you need to weigh up which in that situation you should prioritise - your time with the family or the job?