Interrupting an interesting conversation, boldly buttonholing the guest of honour, or making an obvious beeline for the drinks or food will only cause irritation.
Loitering, wallflower-like, and waiting to be noticed can be equally annoying.
Walk in confidently and make yourself known immediately to the host and hostess. Take time to assess the ambience of the event before launching yourself into the social maelstrom.
When the time comes to leave, make a decisive exit: don’t loiter in the hallway, coat on, prevaricating. Once you’ve decided to leave, say your goodbyes to other guests, and then thank your host or hostess before heading for the door. Try not to disrupt other guests’ enjoyment.
If you are leaving mid-event, make your departure swift and discreet, ensuring that you do not precipitate the end of the party. If you are the last person left, and your hosts are visibly wilting, you have probably outstayed your welcome. Now is the time to make your exit.