The ghost is the best way to simulate a real match since it involves running actual racks and gives a very clear indication of your current skill level. Imagine your playing someone who never misses, anytime you let them get to the table you lose. Beating the 9 ball ghost is no small achievement, and to do so consistently means you are at least a very strong amateur player. For those not at that level, use the variations below.

Variations
Beginner
Instead of the 9 ball ghost, where you have to run the whole rack, play the ghost with fewer balls. To start, use only three balls. Break as normal, but take the lowest numbered balls off the table until you have only the number of balls you are using before starting to shoot. You can do this with any number of balls, 3 is a good start. Ideally, only move up once you can consistently win (over 50% of the time).
Intermediate
If the 9 ball ghost is still out of reach, try the 8 Ball ghost. Break a rack of 8 ball, take ball in hand and try to run solids or stripes. If you don’t run out on your first try, take ball in hand again and try to run the other group. Give yourself a half point for running out on your second attempt. This is good practice for actual 8 ball matches where you must be able to run open tables automatically but also run out with traffic when the opportunity is there.
Advanced
The ghost is great because you can always scale it up. If the 9 ball ghost is too easy, play with 10, 11, 15 balls. Whatever challenges you but is within your skill level. Not giving yourself ball in hand to start is a great way to work on controlling your break, but is an extremely difficult way to play even the 9 ball ghost.
Tips
The break is a big factor in how easy it will be to get out. Devote some time to developing a reliable and controlled break. Hitting them as hard as you can will likely not give you your best chance to run out.
Be accountable. The difference between the ghost and just banging balls around is tracking and resetting when you miss. I repeat, if you are not tracking, you are not playing the ghost, you are just shooting around. Track every single game, if you lose 3 in a row don’t start counting again at the one you win, rattled balls don’t count. Cheating yourself here will lead to a rude awakening when a real opponent doesn’t give you any take-backs.
Start easy. Play the 3 ball ghost a race to 9, move up to the 4 ball ghost when you’d bet your house on beating the 3. You will improve much faster and be much more difficult to beat this way. When using very few balls, save time by just throwing them randomly on the table instead of breaking.