DMs - how to you make your campaigns less 'railroady'?

Hi all,

I'm currently running a campaign that, while fun for my players (I hope!), is really one main storyline with very few subplots for my players to wander off and truly explore. Sometimes, I wonder if I'm railroading them a bit too much, or I worry about the plotline potentially getting a bit stale for them without many other options.

My question is - how do you spice things up/make the plots more varied and numerous in your campaigns? Roll for random encounters? Build in optional B plots to have in your back pocket? Would very much appreciate any advice!