the basics from the GJJ standard curriculum (starts with the stand-up stuff):
https://www.youtube.com/watch?v=Aeg926nPCGQThe basic/general idea is to stay out of punching range, look for a clinch, bring them to ground, get some sort of positional advantage, finish.
This also addresses the "defense against boxer".
There are a couple of specific techniques (very simple and effective) against a sucker punch, a haymaker, etc. But all of it boils down to the above main strategy mentioned above.
P.S. You should watch the early UFCs, at least the first one or two. Entertaining stuff; people punching groin areas, elbowing back of the head, etc.