I had a hard time with this when I started running. As above wait for them to heal completely first, you can’t power through it.
I now stretch before and after runs – but look up some dynamic stretches. Basically warming up by doing exaggerated versions of movements you’ll be doing when exercising, e.g. walking lunges, big steps. Seems to work a lot better for me than standing still and yanking my legs around like I’m in PE class.
Also while waiting for it to heal I focused on small, simple strengthening exercises for my legs and ankles. The cause of shin splints probably differs from person to person but I was also getting ankle pain with it, built up some strength by curling toes, lifting myself up on tip-toes on one foot, then stepping/jumping on stairs.
The last piece was working on my running technique, good posture and short light steps rather than big strides. One or all in combination helped me a huge amount.