If the sync problem is constant, not slowly growing, the Sync Offset should fix that. In fact, that's precisely what it's for!
View attachment 99044
A bigger number makes the audio come later. You won't hear it in the Monitor, as it's pretty much the last thing before it hits the encoder, so you'll have to trial-and-error the recording to get it right.
Record some, load it into your favorite video editor, and see what it takes to line it up. Then translate that back into this setting and try again.
---
For the sound disappearing entirely when it used to work, a common cause of that is using the Default audio device. Default defers the choice of device to the operating system, which can and will change it without warning or any other indication. If you just plugged something in, it'll probably switch to that, otherwise it's anyone's guess.
Default is useful to show that a fresh installation works, with no knowledge of your rig whatsoever, as it's the most likely to connect to what you're already using at that moment. Beyond that specific proof, it's a liability.
So, never use Default. Find and change all of them to the specific device that you know they're supposed to be. Then they won't change.
That works in general too: if you know something, specify that. Don't allow someone else's logic to "just happen to agree with you", because it probably won't at some point.