In these situations, you need some sure-fire fallbacks guaranteed to break the ice and start a conversation. If you're heading off to a party or get-together where you suspect that you won't know a lot of the other guests, it's a good idea to bring something with you that is highly likely to be a good conversation piece. Or wear an unusual accessory or piece of jewelry that will catch people's attention and compel them to ask you about it. If you're bringing a gift to a party, add an eye-catching flourish to the wrapping, which will stimulate some other creative soul to ask you about your original wrapping technique, or about the nature of the gift.
Conversation pieces provide a non-threatening way to start a conversation.
Effectively, you're giving people an excuse to come and talk to you, by making yourself appear approachable and interesting because there's something about you that is an obvious talking point. Wherever you find yourself in the midst of this social challenge, check out your environment. There must be something there which can trigger a conversation with the stranger standing next to you. If you're in a place that is devoid of viable visual cues, use the food or drinks as a starting point. Any of these questions lead straight into a full-blown dialogue.