I've done several. You can buy the springs at your local Menards, Lowes etc. There are a never ending amount of different types and you should take the old one in with you to match up as there are many variables which make it easy to accidentally get the wrong one. No need to order when every big box store in your area carries them.
If it's a torsion spring, you'll need a set of rods to wind it which are like $10 bucks for the pair. If you have more than one spring, they are BOTH supposed to be replaced at the same time to allow even opening.
You'll need a bit of upper body strength to wind the spring (mandatory man card confiscation if you can't). Instructions are in the box and easy to follow. Even at that, if you don't do your own wrenching and/or are the Darwin Award type, then DO NOT attempt it! If you let go of one of the rods with your face in the way, you'll be in for a world of hurt.
Imo the biggest danger is loosening the tension from the spring that's still good.
My garage has a deluxe type torsion spring system which winds with a tool you attach to a battery drill. You just wind until all the painted dashes make a solid line and you're done. If you have that type, it's safe and next to impossible to hurt yourself.
The old fashioned extension springs are easier and a bit safer as long as you have the safety cable. I remember when one of those broke from normal wear and tear at our house when I was a kid. Piece of the spring shot across the garage and embedded itself deep into a 2X4 wall stud. Could have easily killed someone. Garage was built in the late 60s before things like safety cables were mandatory.