For less important events and social gatherings, you could ask your friends to make plans with your needs in mind. It is not unfair to expect true friends to make allowances for your need to attend to religious obligations.
As for a wedding, first you must make sure that you really cannot go to Mass either on Saturday or Sunday. If it is possible to arrive a day early (or even on a Saturday morning) and go to the Saturday vigil, or if you can leave after the wedding for a Sunday evening Mass, then you should go to Mass. If it is truly impossible (and you must be honest with yourself about this, and not count minimal inconvenience to be an “impossibility”), then you can ask your pastor for a dispensation to miss Sunday Mass.
Keep in mind though that if this happens to you “often” then you might need to take a closer look at your priorities and consider whether you are not treating Mass with the importance it deserves.