Putting aside the stage magic, which is trickery, slight of hand as some say. Well it can be hard to figure the difference between a miracle from God or from the Devil, as Paul said Satan can come as an angel of light, and so do his ministers. 

God has given or allows Satan to do some miracles or what some could say is magic. So now we are into "semantics" of  WORDS. 

God does give His people some basic things to stay away from. This tells us, His children, God does not work with the many kinds of contraptions, mumbo gumbo speaking, doing all the things some do who belong to Satan; but we are also told God can use at times, this or that to know His will, i.e. the lot falling on the man God wanted to replace Judas [Acts 1].  But those ways are revealed to us, and it is not that many at all---- the Urim and Thummim, on the Old Testament Priest’s dress, and Lots as I've just mentioned [Acts 1].

Most of the time God chooses to give a "gift" of the Spirit to people, or it is a matter of faith, the woman touching Jesus' hem of clothing. Then he may choose the small apron Paul sent out to heal people, or Peter's  shadow falling over people [both given to us in Acts]. Or Peter just telling the man to get up and walk, but that we could say is a gift of the Spirit.

We are given enough examples in the Word to know how God can work at times. So knowing those things we His people can learn what is from God and what is from Satan. 

We are yet given another very basic from God --- Isa. 8:20—— if anyone does not speak according to God's word, that person is not from God no matter how many magic stuff or miracles they can do, for Satan we must remember is allowed to also work miracles.

We  also get a basic instruction from God. Jesus taught His followers not to use outward vanity showings like praying on street corners so others could see "how holy religious" they were, when they were not at all. We see this today in outward "vain" religious manners as ministers praying on TV or the radio, all the outward "show" that presents to the deceived one this is some real holy man from God, the idea of "O wow he or she is so religious, or " O the outward performance is so religious." Fooling people into thinking they must be from God. So you have all the outward signs from some Protestant fundamental ministers and all their sanctimonious presentations. Or you have the fancy, again sanctimonious in dress and movements of the Roman Catholic Church, especially during their Mass services.

Yes at times it is not easy to discern [for some come with no sanctimonious outward show] those who have power to do or bring about what looks like "out of this world" stuff [call it magic or miracles --- back to semantics again].  This is why God made sure we had the words of ISA. 8:20. THE BOTTOM LINE---- if they do not speak according to God's word there is no light [of truth, God's truth] in them.

AND THEN,  this  is  why  we  have  so  much  instruction, especially  in  the  New  Testament, teaching to hunger and thirst after righteousness, to  prover all  things,  to  study  to  show  ourselves  approved  of  God,  to  love  the  truth.  If  we  do  not,  then  we  can  easily  be  deceived;  going  back  to Paul,  Satan  can  come  as  an  angel  of  light,  so it is no great  thing  if  his  ministers  also  transform themselves  as  ministers  of  righteousness [2 Cor. 11: 13-15].