Guinea pigs should always be kept on a soft surface, as they have no hair on the bottom of their feet and a wire or wooden surface will cause them to develop a lot of foot sores. Because of this though, their toenails will grow, and need regular cutting.
Guinea pigs have four toes on their front feet, and three on their back feet, meaning that there are 14 toenails to manicure. Each nail has a blood vessel or quick running down its centre. If your guinea pig has white nails this will be easy to see, and you can trim just the tip of the nail, avoiding the quick. The quick is harder to visualise if the nail is dark. If you are unfortunate enough to cut the quick just hold some cotton wool on the end and the pressure will stop the bleeding. Alternatively you can buy some styptic pencils containing silver nitrate from the chemist to keep in your emergency box.
If you are worried about trimming your own guinea pigs nails, then a vet or breeder would be happy to do it for you for a small fee.