Complex sentence: Shield bugs have glands in their thoraces between the first and second pair of legs which produce a foul-smelling liquid, which is used defensively to deter potential predators and is sometimes released when the bugs are handled carelessly.
Split into simpler sentences: Shield bugs have glands in their thorax between the first and second pair of legs which produce a foul smelling liquid. This liquid is used defensively to deter potential predators and is sometimes released when the bugs are handled carelessly.