What most people call magic tricks is really something called "sleight of hand." There is, of course, no real magic involved, but there is a great deal of subtle trickery that goes into making a sleight of hand routine appear perfectly seamless and "magical." There are a few basic parts to this method, all equally important: Palming, loading, ditching, stealing, switching, simulation, and misdirection.
Palming means to make your hand appear empty while actually holding an object.
Loading is moving the object (secretly,) to where you need it to be for the trick.
Ditching is getting rid of an object you don't need, or will need later but need your hands free for now.
Stealing is the opposite of ditching, when you get the thing you need without the audience knowing.
Switching is replacing the object the audience knows about with a different object.
Simulation is giving the audience the feeling that something that didn't happen, did.
Misdirection is distracting the viewers from what you're actually doing in order to slip something past them. This is perhaps the most important step, because there are some things that are nearly impossible to do entirely invisibly, and thus you need to distract the audience enough to perform whatever task without their notice.
Once each of these separate components is worked out seamlessly, "magic" tricks become easier and easier to pull off. I attached a video here to show you what I mean. In a single trick, Penn of Penn and Teller each of the seven techniques in quick succession. Penn and Teller are masters of sleight of hand, but with enough practice it is relatively easy to learn to do a few tricks on your own. Enjoy learning!
Posted 3421 day ago