Loosen your grip. Don’t choke your players. Allow them to shenanigan, so to speak.
TTRPGs are not zero-sum games. You can’t loose in D&D.
If your 25$ campaign book can’t handle a little variation now and then, it’s probably not that great a campaign to begin with. If players break your prep, you may have prepped the wrong thing.
Roll with the punches, go with the flow. If you don’t know what the consequences will be, consult your players: our hobby is a collaborative storytelling, for the most part. If you don’t know what to do, take five and consult some random tables.
Re-read this before each session. You’ll be less tired after the session. You won’t to look and feel like Marcin Iwiński and the Witcher 3 meme.