lots of ppl in here are recommending how to quit drinking, which is valid, and would solve ur problem, but its way harder to do than specifically stopping urself binge drinking/overdrinking, which is what ur talking about
obvious first step is getting into the habit of creating a visible limit for urself before u start. scratch markers on the bottle, setting aside max amt of cans/bottles, even pouring from the bottle into a smaller bottle. even if its a high limit, it forces ur sober mind to rationalize the consequences and be honest about ur intentions
obviously enforcing the limit is the harder part, but theres easy things that help. keeping as much of ur stock in a inaccessible location (locked cabinet, another room, a high shelf, anything to make it even slightly inconvenient to access) is remarkably effective. regularly checking in with someone (gf, parent, friend, therapist, even a journal) about your daily limits and how well u follow them helps too. they dont have to be a cheerleader or act disappointed or anything, it just unlocks the instinctive shame response in the human brain that generally motivates ppl to be societally functional
probably wont help for everyone but its my 2c. gl :)