First, talk to your GM and make sure they know you want to replace the character. Most will be fine with this, but you want them to be prepared to help you, and you should also be in agreement about how you'll introduce the new character, what level they'll start at, etc.
Once all that is taken care of, it sounds like you have an unusually convenient option for this. In your own words:
the character turns out to be hard to motivate and the motivations he has are starting to run perpendicular to the rest of the group.
That being the case, you, your GM, and the other players should be able to engineer a scene (as dramatic or matter-of-fact as you wish) where your character realizes they're not really fighting for the same things as the rest of the party, and takes a different path.
Alternatively, you could talk to the GM about altering your character's motivations. Does he meet someone new who makes a big impression? Lose someone important to him? Have a religious experience? All these can dramatically change someone's motivations and actions (though not usually their whole personality). If you otherwise like your character and their abilities, this may be the way to go.