Replacing a rear derailleur (DR) bolt is not a terribly common operation, but it's not quite as simple as you put it and the whole operation is much easier if you take the DR off the bike. You won't need any extra parts, as long as you don't lose the circlip or spring as follows.
It's pretty easy taking the DR off - just stick a 5mm hex key down the bolt and undo it (remove the rear wheel and pull the DR backwards as you do this, else the spring will make it 'snap' around as it comes free. Easy for you in this case, as the bolt is already broken. You don't need to split the chain, because you can unbolt the jockey wheels and take one side of the cage off (make sure you put the wheels back in the right order, as the upper and lower are different). Be careful if you remove the gear cable though - it may be difficult to refit and you'll have to set the gears up afterwards.
Once you've the DR in your hands, getting the bolt out is a bit tricky. First off there is a circlip keeping it in the DR, and this circlip needs to be pushed off. You can then push the bolt out of the DR - at which point the internal spring (which coils around the bolt) will fall out.
To reassemble it with the new bolt, you have to ensure both ends of the spring sit in the holes provided. The catch is you have to 'wind it up' a bit to do this, and you'll find this requires fairly strong hands (plus it's the kind of thing where you wish you had 3 hands). It'll probably take a few attempts to get it back together (serious frustration can occur) at which point you need to push the circlip back over the end of the bolt, to keep everything together.
Finally, you can then screw the DR back onto the frame hanger, making sure the B tension screw (the little screw in the DR, near the pivot) is sitting nicely against the little flat on the hanger.
It does sound like it might be a bit advanced for your current experience to be honest - though it's one of those jobs that is best learnt by doing.
You might also like to browse through the tech articles on here and on the Park Tool website, if you're planning to do more of your own maintenance.