In case of spontaneous karaoke nights, it helps to have something prepared, but it helps to think about what makes a song good for you, rather than just going with whatever is your favourite at the time.
Firstly, make sure it's within your vocal range. As awesome and fun as Bohemian Rhapsody is, it's difficult to pull off without Freddie Mercury's vocal chords, which you almost certainly do not have. Sorry.
Secondly, make sure you know all the words, not just the chorus.
Thirdly, make sure it's something people want to hear. At a karaoke setting, not all songs are equally well received. Something upbeat will almost always go down well. Try to limit the swear words if there are likely to be kids around. It's not easy to tell sometimes, but it's important to remember that your favourite song might not be appropriate, no matter how good you are at singing it.
Finally, have more than one prepared, just in case someone else gets there first.
Most importantly, though - have fun!