One of my plastic shifters broke and I am looking for a replacement on the internet. How do I know whether a replacement will fit my handlebar. Are all handlebars the same size?
Handlebars are (almost) all 22mm = 7/8 inch where the brake and gear selectors go. Any shifter, brake lever or combination part will be designed for 22mm. Drop bars are fatter but the shifters for those are not plastic, so I very much doubt you have those.
The size where they bolt on to the stem varies, but if you're not replacing the handlebar that doesn't matter (so don't worry when you see "35mm handlebars" advertised, that's the size of the bulge in the middle where they attach to the rest of the bike).
What's more important is the number of rear cogs you have. If your current shifter is 7 speed, you need a 7 speed replacement. Ditto for 8,9,10 or 11 speed. Also, the brand of the shifters matters, you'll need Shimano compatible or SRAM compatible for it to work properly.
As DWGKNZ says in comments, replacing this part yourself is a bit of work and you will probably want at least a new gear cable (the wire inner part). Getting it adjusted properly is tricky but there are lots of tutorials on the net like this written one or this video. Note that they focus on the derailleur end because that's where you do the adjustment.