That's easy: never make unconscious purchase decisions. Consciously set a list of what you want, and follow it. If you know what you want, there is very rarely more than one product that comes closer to meeting the requirements, whether they be objectively measurable, more abstract like quality and trust, or as simple as price. Generally sellers try to find a distinguishing niche, and stick to it.
Of course this requires knowing and caring about what you're purchasing. If you have enough money to just go by "ooh, shiny!", then sure, ads can have an influence.