Abstaining from alcohol is the only guaranteed way to prevent a hangover, but can electrolyte drinks help if you do want to say cheers with friends?
https://www.eatingwell.com/article/8043337/electrolytes-and-hangover/