Stingrays are not known to be aggressive or act defensively. Their primary defense action is to swim away from the area.
When entering or exiting the water, shuffle your feet in the sand rather than taking big steps. This alerts the stingrays to your presence and gives them a chance to swim away.
Be cautious in shallow water and look for any disturbances in the sand that might indicate a stingray's presence.