I have been DMing the same campaign with two sizable hiatuses for three years now. (I say two because the two hiatuses add up to a year.) And now that my game is wrapping up in a couple of weeks, I just wanted to share some lessons that I have learned into the ether.
Firstly, not everything has to be structured. I have done a few one shots made up on the fly with maybe one or two prompts from one of my players. If you are a new DM then for structural reasons I would recommend sticking to a sourcebook, but if you have DMed at least something akin to the Lost Mines of Phandelver and want to try being more adventurous it is possible. This advice even goes for long time player too, recently I played in a one shot made by one of my longtime players who made up her own one shot from the top of her head. Everyone in the party, and a guest player, all thoroughly enjoyed the sessions and it was a resounding success.