By regular exercise and maintaining discipline in eating, sleeping, working etc. Some of the best exercises are swimming, skipping with a rope, quick pace walking - depending on the age.
Young people can go for exercise in a gym where you have coaches to guide.
Only exercise cannot keep the body in good shape. One needs to sleep well, eat nutritious food and in enough quantity, avoid overeating. There should be fixed intervals to eat. One should avoid alcoholic drinks, smoking and eating paan because these things are not good for the body.
I know of persons who do not use any instrument but only do free hand exercises and are perfectly fit and in excellent shape.
Your vote on this answer has already been received
Keeping fit has to be made part of life. Living active life, taking stairs in place of lift, spending some time in outdoor activities, controlling craving for junk and oily food .... are not easy tasks but can be practiced. Someone told that your choice of company makes big difference in keeping your physical, financial and mental health in good shape.
I am fortunate to be in company of fitness enthusiasts.