Trial and error...
These rubber donuts are placed along the length of the barrel where they do the most good. How do you know where that is? Simple: You have to put it at the halfway point, and shoot a group. Shoot the very best group you can because if you fly one out there, that throws off the results. You have to shoot close and tight, then move the thing one inch in either direction. Shoot a super-fabulous group again, and see the difference-- if there is any. There should be because the donut dampens the vibrations of the barrel.
You're trying to shoot really good groups so your results are consistent when you move the donut. If a one-inch move blows the group up, try a half-inch move. This is the trial-and-error of the exercise. The idea is to find the location along the length of the barrel that gives the best groups. You'll need lots and lots of tediously-loaded ammo so you're shooting the same load over and over as you move the donut.
If your barrel is matte stainless, use a Sharpie pen to mark the initial location of the donut. You'll need to know from where you started if you want to know at where you'll stop. If your barrel is blue steel, you can use a drop of white nail polish to mark your starting point. You could use a wrap or a small piece of masking tape for either type of steel if putting something on your barrel is not a cool idea for you.
Shoot a group, assess it, allow the barrel to cool, move the donut and shoot another group. You will eventually find the exact location for the donut-- if you have enough ammo...