The “d” in the contraction of “had” changes to help with the following /b/ sound, to be pronounced with the lips, making it like the beginning of a /b/, but don’t release it, just pause, and release on “better”. You’ll need to listen and practise.
“We’d better” is a suggestion, and “leg it” means run, so this means “I suggest we run.” You might say it if you’re running late, or if you see something scary like a zombie, vampire, or maybe your boss.