Some guinea pigs urinate randomly in their cage or hutch and cannot be litter box trained. Other guinea pigs will prefer to use one area in the cage for their urine, often near the hay rack or where the floor is covered over. Try placing a litter tray in this soiled area with some soiled litter in it. If the soiled area is near where they eat hay, then you might find you need to put some hay for them to munch on while using the tray. If they are urinating in a covered area, then you may need to rig up a cover for the litter tray somehow. You probably won’t be able to litter train for poo!
There are now corner litter trays available for small mammals. Make sure you buy one which is low enough for the guinea pig to use. Some like the Options corner litter tray have clips to clip to the side of the cage, so that the guinea pig cannot move the tray about. Any plastic container, cut low in the front, would also do.
Do not use cat litter. Use the same safe litter that you are using on the cage or hutch floor. If you are using hay for the floor, then use proper guinea pig litter for the litter tray. Read How to House Your Outside Guinea pigs or How to House Your Indoor Guinea Pigs for details of the litter.