You can of course plan the big lines of the campaign, but the more precise you get and far ahead of the present, the more you will either lose or railroad to not lose. Both suck
I've had some success planning "set pieces" instead of sessions. I'll generally know what kinds of enemies the party could encounter at any given time and just have some fights ready just in case. Same thing with NPCs, I'll have a bunch of names and simple descriptions on a sheet so I don't have to make them up on the fly (and as a bonus they're now written down in case they come up later and I forget who they were)
I've had some success planning "set pieces" instead of sessions. I'll generally know what kinds of enemies the party could encounter at any given time and just have some fights ready just in case. Same thing with NPCs, I'll have a bunch of names and simple descriptions on a sheet so I don't have to make them up on the fly (and as a bonus they're now written down in case they come up later and I forget who they were)