Probably you don't -- unless you are able to heavy punch with him.

Likely you need to MOVE, get some distance, positioning, and prevent him from getting to that position by movement and counter punching.

Once he is on you then it is usually a bad idea to "brawl" or "slug it out" with a stronger, tougher puncher -- I am assuming he is a better puncher or you wouldn't be worried about it.

You might be able to "short cut" his hooks with your ow SHORT hooks or straight (short) punches, but then that is another set of skills you likely don't have yet or you wouldn't be asking.

If you have the skills you can of course stay inside and just make a fight of it with him -- when two high quality heavyweights do this it makes for some of the most crowd pleasing fighting in boxing (not necessarily the best boxing, but crowds love it.)