Trap once, that’s the rule when installing the drain line, usually outside right before the water drains out the pipe. No trap, and you get the vacuum, lack of airflow causes the same thing. Use a shop vac to “suck” out the drain outside when maintaining. Never add anything corrosive to your drain line, such as bleach, when flushing the line. That’s it!
I’d recommend HVAC-talk.com if you wish to explore.