As MowMow noted, if the sample is to test for urinary crystals or infection, the only way to get accurate results is to have your vet extract a sample directly from the bladder by cystocentesis (a thin needle inserted directly into the bladder through the abdomen).
When I had to collect urine from my previous cat, I had emptied out the litter pan (as suggested by my vet) and waited for her to use the litter box for that purpose. She wouldn't go in but was pacing back and forth so I knew she had to go. So I called the vet right away and they recommended that I place a very small amount of litter in the pan which would trigger the cat's instincts to go in it. It worked like a charm! As she positioned herself to pee, I was able to collect the urine on a plastic spoon and then poured it into a urine speciman cup. I would have preferred to follow what the above posters suggested, but my vet did not offer that option and I didn't even know you could do it at the vet (but I am sure it costs more money, yet prob much more accurate).
I'm giving Paizly Methigel, and it says that for older cats you're supposed to be testing urine "on a regular basis" to monitor the PH level and keep it stable. I figure that's once a week, though I suppose I ought to do more research and see if once a month is okay. She hates me groping around down there to express her bladder, and nips at me...so maybe once every 2 weeks would be enough.