If you're debating you've already lost the debate. The effective way to win a debate is not to have one. You either convince the other person the idea was theirs, which is easier than it sounds, or you get them to argue your point for you at which point it is their idea. Learning how to do this takes effort and a willingness to realize how little one truly knows about the art of effective speaking. You'll also begin to recognize when other people are manipulating you using this method. A really quick trick for this method is to start a conversation with something the person said and then say that what they said gave you your idea. Very few people won't take the compliment, you'll immediately validate their who ego and intelligence, and they'll immediately feel like you owe than something which means they'll want to be around you more. A good book as a primer for this is Influence by Cialdini.
Here's the kicker it even works when the person knows you're doing it. So it was good you brought this idea up, it allowed us to have a really good conversation about it and explore it more fully.
> You either convince the other person the idea was theirs
No. I used to read and follow advice like this. End result is that your ideas are considered other peoples ideas. They get credit and are rewarded, not you. Doing this regularly literally harms you and makes you to be perceived submissive, unsuitable for leadership positions.
Moreover, it makes you great target for bad actors.
As someone who used this very technique to get into a leadership position, there's a difference between using this to give other people credit and using this to get people into your side. The idea is to have a win-win situation where your needs and theirs align. You should have something to consider a win for yourself out of this. As an example, you have a customer who defines success as X. In order to get to X you need feature Y. By having a conversation with the product manager you use leading questions to get the product manager to suggest Y. You agree, the product manager gets a win in a new useful feature the customer loves, your workload goes down and the customer sees you as invaluable. Customer retention goes up and you get to celebrate that win for yourself.
It seems like a lot of work, but if you do this continually then you build trust with other teams, and you become more skilled with the process. Bad actors generally aren't smart enough to realize when you're giving them rope to hang themselves so this same technique can be used against them and they will look insane blaming others for their own bad ideas.
It sounds as if you could use a mentor to guide you through the technique and avoid the pitfalls you fell into. I'd also suggest learning how to effectively market yourself. I'm nothing special, don't have a bachelor's degree, and used to have terrible people skills. I'm now highly in demand and effectively can make my own roles wherever I go. It's definitely possible for anyone to do.
Here's the kicker it even works when the person knows you're doing it. So it was good you brought this idea up, it allowed us to have a really good conversation about it and explore it more fully.