There are many variables that must be considered when choosing the correct lens for your camera and application. Generally people start with the lens field of view which is directly correlated to lens focal length (for a given sensor size). This determines how much you can see.
Next there is lens resolution, which should match or exceed the sensor resolution. And for wide angle lenses, how much lens distortion is acceptable. This determines how well you can see. The higher the resolution, the more detail in the image and the easier it will be to pick out a person or license plate or barcode from a given distance.
Beyond that, lens selection is guided by your application and could include f/# (how much light is required for an image), mount style (C, CS, M12, etc.), motorized zoom/focus/iris, visible/IR light correction, physical size and of course lens cost.
Theia provides a helpful tool for exploring the interaction between field of view, object distance, and resolution in our “image resolution simulator and lens calculator”.