I had to do this once and this is what I did - I got my baby to sit on a potty and pass urine. After that, I collected it into the container the hospital had given me.
She was already going on the toilet seat, so it wasn't difficult getting her to go on the potty.