One way to deal with it is to educate the person using it. Explain that such phrases are not only inappropriate but also offensive, especially when it comes to topics related to the gay community. You can introduce them to more appropriate ways of discussing relevant issues, like focusing on equality and acceptance. Also, if it's in a public or online setting, report it if possible as it violates basic standards of decency.
Firstly, don't engage with it on the same inappropriate level. Instead, redirect the conversation towards positive aspects of the gay community such as their art, literature, and positive social impact. If it's in a written context, like a comment section, you can flag it as inappropriate. We need to create an environment where everyone feels respected, and dealing with such inappropriate phrases is part of that effort. Encourage others to use respectful language when discussing any community, including the gay community.