I do magic to my friends at school. I was in a class with a friend who knows I do magic and I was doing it to other people and he came over. He has an idea of what I am doing and he started blabbering about what I did. I wanted to keep showing the other people because it was engaging to them but not my Friend. I don't want to be mean to him but he is trying to reveal how I do stuff. What do I do? Do I not do magic when he is around?
Does he know the method? Then as suggested above, the only way to sort things out is an honest talk bout it with him.
If he does not, eff him!
If he does not, pretends to know and show other that what you are doing is nothing great in particular, just hand him the cards or the coin or whatever. Then just watch him attempt to salvage his ownself.
Or else just perform something else! He can't know how everything in the world is done! If he wants attention, give him a little of that. Go ahead and do an effect which implies HE did the magic. He will feel important, other would still know it was actually you who did the magic. Case solved.
Can you really call that person a friend if he is insecure with your success?