I think the most important things you can do are:
1. Be patient and stay engaged with this friend, 2. always offer a shame-free way out, and 3. use common ground to help them re-center themselves in reality.
1 - By stay engaged, I mean keep being there for them. But make it clear that if they want to talk about their stuff, you're going to share your thoughts on it too because that's how conversations work. If you need to cut them off for your own sake, ok, but just keep in mind you are one more normal sane person in their life and as much as you might not know it, your perspective matters at least a little to them.
2 - Since many of these Trump/Q cults are chiefly online, leaving probably isn't that hard. That's a silver lining of the loneliness epidemic we're dealing with I guess. But if you use inflammatory language when your share your thoughts on people who believe this stuff, then leaving the cult requires them to think of themselves as idiot suckers who bought a load of crap from a weirdo on the internet.
3 - Invite them to do normal, healthy, outdoorsy kind of stuff with you. Try to get their mind of the usual stuff they ramble on about. Invoke common ground, ie device addiction is bad let's do a detox, or there's too much partisan bickering let's do some local volunteering/community helping. These cult-vulnerable people see a broken world and have been sold ways they can help fix it. If you can focus on some of the things you agree on as broken with obvious uncontroversial solutions those are good options.
Best of luck.