I've done this a few times, and my friends have done this a few times. It is not an enormously complex interaction.
- You tell the other person (or people) that you wish to no longer attend this game. You tell them there is nothing wrong with the game, you just don't feel it is the kind of game for you. (That is the case here. That makes things pretty simple.)
- Wish them all the best and that they enjoy themselves, thank them for the time you had if you feel so inclined, and part on good terms.
- They may reasonably be concerned, feel they've wronged you somehow — assure them that no, they've been fine, it is nothing more than this game isn't for you.
- If you're already their friend and in touch with them, you may wish to reassure them you'd still like to stay in touch or somesuch.
That's it. In general, this will be fine and they'll understand. You shouldn't make stuff up — just be honest, there's nothing wrong here. This is a generally useful social exit in a lot of circumstances, it's not RPG-specific.
For (not) making stuff up: there's no need. The truth is fine and will keep things simple. If you lie, they'll be upset later when (probably not if) they find out, and you'll limit your opportunity to interact with them in the future. Imagine someone starts up another game a few weeks later you'd love to join: if you were truthful, you can go right ahead; if you made stuff up, you either simply can't, or if you join this will probably be the point they find out you made stuff up.
If they ask for parting feedback, you can of course give it. If the game was fine for what it was, just not the type of thing you go for, there might not be much feedback to go into, and you can say there isn't much. (Don't take this as an opportunity to tear into the game and point out all the things that were wrong from your perspective. You're leaving! None of that matters now, and can be taken as an unpleasant parting shot.)
Geek social issues might make things a little more complex sometimes.
RPG players are often reasonable, mature, socially healthy adults. Sometimes they're not 100% there yet. Sometimes they have the five geek social fallacies to deal with, or other social issues, including simple social ineptitude.
One of the geek social fallacies is that friends should do everything together, so them doing something without you, if they're your friends, might take some adjustment on their part. It'll feel weird. It felt weird for my friends and I when we individually started recognising there were board games or RPGs we weren't interested in, and excusing ourselves from those activities. It took some reassurance that nothing was wrong, this was fine, go ahead and play without me, have fun. Just be compassionate as they adjust.
Sometimes during these activities I've visited their table just to sit and read a book and watch. They feel easier for me simply being there, though I'm not playing their game. (I wouldn't do this with every group or with every game.) This is less applicable to the online space, though.
On the rare occasion where things turn ugly and verbally abusive (has happened, hopefully will never happen to you), remember you're doing nothing wrong. It's best in these cases to disengage: "The game was fine, I mean no offense, and I'm not comfortable with you responding like this. Talk to me later when you're calm." Don't get into arguments, don't sink to their level.
Overall just remember everything's OK this way, and help the other people feel OK with it too if they don't.
You may wish to address your issues before you leave. (Or you may not!)
Some of these issues you have with the game may be repairable — your character has very little influence on events or plot, and you have little opportunity to express them.
If you believe these issues can be resolved, and the GM and players might seriously integrate your character in a way that'd make the games satisfying, and you genuinely want that, you could just tell them about this and ask if there's any way you get the results you want, and try to work with them to resolve it.
It's fine if you decide you don't want to do this, or don't think it'd work, or etc. That's up to you. It's fine if you still want to excuse yourself. Leave as normal.
If you do, though, work with them. If things work out, great. If they don't, leave as normal. The reason it isn't your cup of tea is you couldn't figure out a way to express your character, and you can acknowledge this. (Don't tear into people for it — "you didn't let me!" — just keep it simple.) They'll be bummed out, so might you, 'cause it's regrettable it didn't work out. You can acknowledge that too. Thank them for trying to make it work, assure them that everything's fine otherwise, and that (if it's the case) you'd be on board with playing with them again should another game appear you feel you could work with.