How to find the right main hydraulic pump for your excavators?

It is difficult to find the right replacement main hydraulic pump. It is hard to return this product due to its high price and large size. So how can you make sure you find the right pump the first time?