Not so much how to practise, but how to make the difference between a regular strike & a rimshot easier to determine, plus an unexpected extra benefit.
Change your snare drum angle.
Or even all your drums' angles, if you want to be able to do this with accurate repetition round the entire kit.
I have my entire kit set in such a way that the difference in stroke needed to clean strike or rimshot requires possibly as little as a 2mm difference in how I aim for the skin. [I've never actually measured it, but it's very small]
The downside is when you're first practising, you may tend to rimshot when you didn't mean to.
A slight 'cheat' to try prevent that for the snare is to set the height so if you rimshot, your hand hits your leg too, very slightly.
YMMV on that one, I guess it would depend on how close into the body you set the snare. Too far away & your knee-height will change too much as you play hats & kick. I keep mine tight in, so there is only very small variation. I also predominantly strike the skins about ⅔ towards the far side, for extra ring; I rarely pull back & hit in the very centre, so I am probably naturally a couple of inches closer in than most drummers sit.
The upsides are two-fold.
The small angle-change required makes it eventually very easy to switch from one to the other with little more than a thought.
The perhaps unexpected second benefit is that the perfect angle to strike a skin to get the best sound from it is actually about 1mm before you hit the rim. The flatter your stick to the skin, the sweeter the strike. Also - less effort input for more potential volume output.
As to left-heavy exercises …
Play entire songs in only rimshot.
In many gigs across the years I've had occasion to do that for some songs, as that's how they were written, or that's how to generate a sound closer to the original track, etc, without swapping snare drums over.
It certainly builds reliability of successful repetition.