The story I'm working on heavily involves the gods of ancient mythology, who dwell in the world of desires and ideas (think something like Jung's Collective Unconscious). Some of the gods end up being antagonists, but I have no idea as to how the protagonists would actually defeat them. I know it would involve them going into the spirit world, but I don't know how you kill a being that's essentially an idea. If anyone has any ideas, I'd love to hear them.
If I had an idea that's another deity which tells me that to exist they need to be thought of and so, over time, they may eventually fade to be. Or if you can keep them "trapped" and out of people's heads long enough, they cease the exist. For something faster, probably a weapon that causes a mass memory wipe when you can hit the deity with it. Not sure.
A technique often used with very powerful and aethereal villains is for the heroes not to fight them directly, but instead fight their servants and undo their actions, maybe send them away or weaken them. e.g. In the final season of Buffy the Vampire Slayer, the main villain is totally incorporeal and never really faces of against the heroes, put commands an army of powerful servants and influences things in ways they try to counter.
How literal (surface) or how symbolic (deeper) do you intend to present these gods, and, at least in a general sense, what tradition of goddishness do you intend for them to follow? If these gods were to follow a Hindu framework as regards what they are, what they mean, how they interact with one another, then the answer would be to defeat the negative or destructive idea within oneself that is represented by the god or goddess in question. In most forms of Hinduism that have not attempted to place one of the gods above all the rest, it's understood that they are all facets of a greater concept that stands behind them called Brahman. Brahman is not a thing that can be understood by the human mind because it is literally everything that ever has or ever will exist in the entire universe. It presents itself in facets small enough for us to engage, which are the Hindu gods. That's why there is a nearly infinite array of them, why each has so many incarnations, and why most are understood to be conceptual pairs and opposites. Just examples... Kali, the Devine Mother, is one of the Mahavidyas and thus a consort (lover) of Shiva. She's depicted as a scary-ass demon with skulls dangling from her hair, and she's often shown standing on Shiva's body. Kali represents the person you meet when you stand between a mother and her child, a fool's venture. But if you aren't threatening what Kali is trying to protect, then as one of the Mahavidyas (who are all aspects of one another), she is the most beautiful of all, the Devine Mother. Her duality is found within two modes of the same god. Shiva and Parvati (another of Shiva's consorts) are the divine lovers. Their act of consummation brings the universe into existence. Shiva, in the form of Nataraj, is called The Destroyer, but you have to look at his whole family to understand how that's balanced. Nataraj (Shiva) dances his ecstatic dance and wipes the slate clean, holding ignorance under one of his feet, trying to keep it under control, so that the clean slate he creates can be as perfect as possible and the clean area can be at its best for new creation. The son of Shiva and Parvati is Ganesh. Ganesh is the vessel of infinite wisdom and patience. He is the remover of obstacles. Ganesh is the god that is invoked at all new beginnings to bless the fresh start. Daddy Shiva wipes the slate, Son Ganesh starts the ball rolling again for something new. BTW, if you've bothered to read this far, seriously, I'm not trying to proselytize Hinduism. You said the gods in your story are basically ideas. The gods of Hinduism are engaged much the same way since they are all understood to be tiny fractions of a greater thing standing behind all of this. I'm just showing how they parallel. So, in your story, could you employ something similar? Could your antagonistic gods have counterparts? Do they actually have to be killed, or can they be conquered? Can other gods in this spirit realm serve to help in that goal? Would the defeat of antagonistic gods be part of the human story of your characters? Could it? Should it? In most mythologies where humans meet the divine to do actual or metaphorical combat, there's a deeper story under the surface story, an allegory in play. It's rarely just random.
I have a character who is a ghost (much the same as your gods death-wise) He's afraid of space, certain high frequencies of electricity, EMP, and high gravity.
There's no need to apologize for the long post, as I find them the most interesting. I've done quite a bit of research into Hindu mythology, and I find it quite fascinating. The gods in my book actually work similar to how you described; being parts of a larger whole.
This is probably too obvious to even mention, but authors have frequently dealt with similar issues by inventing a mystical god-killing artifact, or even just a weapon (doesn't have to be a literal sword or gun) that came from the realm of the gods. It doesn't sound like you're looking for a Perseus or Frodo style solution though. Depending on the rules you establish, ethereal realms often follow the same rules as the human plain of existence. In other words, if your characters can find a way in, they can kill as easily as they would in their world. Obviously it would be a monumentally greater task than killing a human, but you get the idea. Conversely, another established way out is to drag or lure the god/monster/ghost/whatever out of the place where they're invincible and into the mundane world where they're vulnerable. You could also go old-school Greek with it and decide that since they can never be killed, they'd have to be swallowed up by another god and live in their belly indefinitely, or worse, be tortured nearly to death on a daily basis for all of eternity. That could get pretty dark though. I don't know the mood of your prose. One could also be less literally swallowed up and have their power, energy, essence, etc. absorbed when defeated by another god. Murder by osmosis, so to speak. Just some ideas. No idea if they'd fit what you have in mind.
To kill an idea? Well, ideas only work if there are beings with a consciousness around to be influenced by ideas. So, you could have your main characters kill every living being that has a consciousness in existence and your God becomes worthless, essentially. After all, can't manipulate or corrupt anyone if everybody is dead. Is this idea too extreme and genocidal? Probably. But that's how I'd write it if it were up to me.
It's a total cliche, but for years writers having been killing off gods by having the world forget about them or even just turn their backs. Maybe you could find a fresh way to make that work. There could be some SF element that actually makes people forget.
You could could take a page from sci-fi and adapt it for mythology. It’s common in sci-fi to trap individuals in a simulation that they don’t know is a simulation. The Matrix was all that, Ready player One used it, and it was repeatedly done in Star Trek. You could trick the god into creating a new world and sticking it in there, it never knowing the difference because it’s an essentially perfect recreation. It’d also play on your theme of it existing in the mind. In the end, you literally trap the god in its own mind. It’s a common problem in existential philosophy. If you could provide sensory input to a brain, what it feels is indistinguishable from reality. It’s entirely possible that you are a brain sitting in a vat with electrodes connected to it.
Memetics is your friend here. You can jump over The Selfish Gene (Richard Dawkins) straight to Susan Blackmore's and from there to anywhere. https://en.wikipedia.org/wiki/Memetics https://en.wikipedia.org/wiki/The_Meme_Machine Terry Pratchett did use memetic ways to "kill" gods. It worked well.
If we're talking Jung's collective unconscious, wouldn't a cool way to harm said Gods be if individuals accepted their shadow and conquered the Gods within themselves? Maybe by defeating them inside your own conscious, you can sever their ability to effect you?