If the underwear became wet with urine then yes you need to remove it before praying. However if you wiped yourself clean with a tissue and the wetness of the urine did not transfer into your underwear then it will not become najis however to pray you would still have to wash yourself