I want to make a device that can detect a viruses or bacteria
Bacteria fluoresce when you shine UV light on them.
Only a subset. Definitely not all of them.
True, however polluted water is populated by fluorescing bacteria. They make fiber optic probes to test water for bacteria content that way. Here's an article.
... The only true test is to either grow them out or do PCR.