How to change a religion?
It can be done, but it's long and full of effort operation. You have to begin with proper education of the descendant. If we choose a mentor who is an infidel with a high Learning, there is a big possibility that the child will gain the religion after his mentor. And when your character dies it's enough to play as this infidel son. But it has to be mentioned that such action is totally unprofitable: because your subordinates won't follow your change of religion automatically. What means long and expensive converting of all your subjects in all provinces.
Easier is to use one of the random events: if one of your bishops decide to change his religion, he'll probably try to convert you. Just agree his proposition.