I used to get them 20 years ago when I got back into running. Here’s what worked for me:
1. Walk the first 10 minutes, upping the pace. Run for a few mins then walk. Run some more than walk at the end to warm down.
2. Get home, apply ice packs to shins while elevating them.
3. Ride your bike to build strength without that stress of running.
Step 1 made a big difference immediately because previously I had gone straight into running mode and getting pains.
Step 2 was something I’d read about and gave it a go. I think it helped a bit, but not as much as 1 and 3.
Step 3 worked because I then decided to get back into riding and ended up replacing a few runs with rides. This definitely helped build muscles/strength around shins/calves in a less stressful way.
Just my tuppence.