I am learning to rock climb, and I have heard that I will need to belay climbers, so if they fall, my belay will stop the fall and prevent an injury.
What do I need to do to properly belay my climbing partner?
I'm not sure that this is something that can be properly explained over the internet.
You really need to be instructed and supervised by a real person - preferably indoors first. I have found a pretty good instructional video on YouTube, although it is quite basic - I've reviewed a few others on there, and they are unfortunately questionable in their technique.
Belaying is about judgement - you need to give the climber enough slack that they are free to move up the crag, but not so much that they will fall too far if they slip. How you approach belaying will depend on whether the climber is leading or using a top-anchor.
About the only thing I can state absolutely over the internet - you always need to have a grip on the rope that is trailing from your belay/friction device down to the ground. A loose hold on this will just let the rope run through your hand(s) freely in the event of a fall, given you friction burns and endangering the climber.
Of course there are other safety issues as not standing under the climber, wearing a helmet, in case of rock fall. As mentioned above, you should have a qualified guide. Those most qualified will be certified by the American Mountain Guides Association (AMGA). Most local rock gyms do have training and most outdoor stores that sell climbing equipment have training sessions. Climbing is a sport that can result in injury and death and choosing to do so should not be taken lightly.