With most piggies you'll have to work on taming them, getting them used to you and doing your best not to do things to startle them, even tame piggies will dash from sudden movements, its just instinct for them. The above posters have good advice- if in doubt food!
Some piggies are naturally more skiddish or have learned to be skiddish and will take longer to tame than others. I find that the braver and more inquisitive the pig the easier and more willing to come out of the cage they'll eventually be (many will still run but still enjoy lap/floor time, they just run from instinct).
One of my boys came to me very skiddish and it took a long time just to be able to have a calm laptime with him (he still runs in the cage, after about 2 years). He'd bolt at the smallest thing and so required a lot of constant watching in a quiet, safe place (he'd manage to run up your chest and down your back in a split second if startled, he even ran straight up the side of the couch once). He'd also cry the whole time for the first few months. He's pretty good about laptime now, he sits good and doesn't cry and enjoys some petting and food, but it was a slow process.
Piggies that like to sleep out in the open, on raised surfaces, investigate other animals, don't flinch at poking, etc even from a young age are the ones that'll likely be very willing to come out of the cage on their own later on, given you don't mess something up. They seem to be less instinct ruled. If they're not running from you in the cage I find that offering your arm in a way that allows them to crawl up onto it is a great way to get them out of the cage because they often will do just that. No piggie really seems to like being grabbed, especially from behind, but some will jump or crawl up onto an arm place infront of them or under their chest.