I'm going out with this girl but she lives almost 300 miles away, how can I make sure it works out?
You can never guarantee anything. But speaking from experience (I did the same thing for over a year), make sure you communicate. *Especially* when you're together. If you don't see each other often, it's easy to just try and take advantage of the closeness, but that's when you really need to talk. You can talk on the phone for hours every day and still not talk about what really matters. So just make sure that if something is bothering you, you tell her, and try and make sure she does the same.
Communication is truly great advice, but I'd also add that it can be helpful to normalize any physical time together. From my experience, it can be tempting to treat every second almost like an emotional vacation. "We can't fight, we only have two more days together!" "I can't go to work, we only have a couple days left."
For a relationship to work in the long term, you have to be comfortable with each other as real, flawed (but perfectly wonderful and lovable) human beings. Dealing with jobs and time management and everyday frustrations are a great way to find out each other's quirks and how each of you deals with the messiness of life. Don't blow off your normal activity for your significant other. Invite them into your normal life, and see how those normal lives mesh.
I've had 2 long distance relationships, neither worked because of the time of life I was in, not the distance.
I think the key is treating it like a normal relationship but make sure that you make time for each other.
Also be honest with each other, don't pretend to be happy when you're not, just be as you would if they were with you in person