How do you filter lookup fields?

How do you filter lookup fields?

so I basically subcontract services. i've created some custom modules.  "Service Vendor" and "Services"

I want to be able to then have a contracts modules that I built have a drop down for "vendor", then The services drop down gets filtered for the services that the vendor offers.

so Vendor A offers Services 1,2,3, Vender B offers Services 4,5,6

If i select Vendor A in the first lookup field I only want to see services 1,2,3