If a katydid has diarrhea, here are some treatment methods.
First, check its diet. Maybe it ate something inappropriate. Remove any potentially harmful or unclean food sources. Provide clean water and fresh, suitable food like tender leaves of plants that are known to be safe for katydids.
It's also important to keep its living environment clean and dry. A damp and dirty habitat can lead to health problems. Replace the substrate in its enclosure regularly to prevent the growth of bacteria and fungi. If the diarrhea persists, it might be a sign of an infection or parasite. In such cases, it's advisable to consult an expert in insect care or a veterinarian who has knowledge about invertebrates for more specific advice and possible treatment with appropriate medications.