Practice, basically. Try playing along to some well-known pieces to get an idea of how songs flow. Start with just a chord sheet, then, as you get more practice, try without. You might also study some common chord progressions and cadences to help you "predict" where a song will go next as you play.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.