This is pretty simple and works great. It just puts some water between the feeder nectar and the hanger wire so that ants (who can't swim) can't get to the nectar. I designed it for the hummingbird feeders like the Aspects 433 Hummblossom, or others that hang from a 3mm (approx) diameter wire. You could also scale the print size to fit whatever wire yours hangs from, or stretch its length so it holds more water if you wanted. I printed mine from TPU so that it would squeeze onto the wire and hold there, but you could print from other weather-resistant materials and use something like a bit of tape or a grommet to hold it up. Or, if loose enough, let is sit all the way down on the feeder.
If you print via FDM, you will pretty much certainly have to seal the plastic (inside at least, both inside and outside preferable) so that it holds water for a while. I had some “Kilz” primer/sealer, which has worked pretty well so far. Of course, the water will evaporate over time, so you'll have to refill it before it reaches the bottom.
I tried using cayenne pepper instead of water, as I read that ants don't like to walk over hot pepper -- but they just ignored it and went right over that! Maybe peppermint oil or something like that would work? (Do make sure that whatever you put in the moat can't hurt the birds should it leak).
Also check out the umbrella add-on for this at https://www.printables.com/model/1179836-umbrella-for-anti-ant-moat . Keeps the nectar from getting watered down by the rain.

The author marked this model as their own original creation.