If you find them prepaired they'll usually stick together when released, but I've paired unpaired one successfully, you pretty much just wait and they'll eventually find each other
My last pairing was a YWG and Tiger pistol, the YWG had been living at one end of the tank the shrimp ended up on the other end when I released him but they were together in a week.