We have a water butt which is fed rainwater from a downpipe from the roof.
It is beginning to smell, and wonder if there are tablets or something to prevent this
Good maintenance should prevent this happening. At least once a year you should empty it and clean it out otherwise you can get a sludge at the bottom.
I would be wary of using tablets or additives especially if you use the water on vegetables, plants or if there is a risk of the water reaching a fish pond.
I found this, which seems expensive to me but you might like it