I get healthy by losing weight by walking 30 minutes every day.
Is it correct to use “by doing” in a row as in the sentence above I created?
Its possible but should be avoided: There are ways to do this, for example
I get healthy by walking 30 minutes every day to lose weight.
But actually walking 30 minutes each day is neither necessary nor sufficient to lose weight, so perhaps better would be just to use “and”
I get healthy by losing weight and walking 30 minutes a day.
I walk for 30 minutes every day to lose weight and get healthy.