How do you deal with bugs, bacteria, and fungus damaging tomatoes and peppers?

here’s one of those black attachments. i was able to pry them loose this morning. one fell somewhere and is lost. the other i retrieved and appears hollow on the inside.