Dyes are primarily used in diagnostic techniques like histopathology and immunohistochemistry. These techniques involve staining tissues to visualize cellular and tissue structures under a microscope. For instance, hematoxylin and eosin (H&E) staining is a common method used to differentiate between cancerous and normal tissues.