So they took Jeremiah and dropped him into the cistern of Malchiah the king's son, which was in the guard's courtyard, lowering Jeremiah with ropes. There was no water in the cistern, only mud, and Jeremiah sank in the mud.
References for Jeremiah 38:6
But Ebed-melech, a Cushite court official employed in the king's palace, heard Jeremiah had been put into the cistern. While the king was sitting at the Benjamin Gate,
References for Jeremiah 38:7
Ebed-melech went from the king's palace and spoke to the king:
"My lord king, these men have been evil in all they have done to Jeremiah the prophet. They have dropped him into the cistern where he will die from hunger, because there is no more bread in the city."
So the king commanded Ebed-melech, the Cushite, "Take from here 30 men under your authority and pull Jeremiah the prophet up from the cistern before he dies."
So Ebed-melech took the men under his authority and went to the king's palace to a place below the storehouse. From there he took old rags and worn-out clothes and lowered them by ropes to Jeremiah in the cistern.
References for Jeremiah 38:11
Ebed-melech the Cushite cried out to Jeremiah, "Place these old rags and clothes between your armpits and the ropes." Jeremiah did so,
and they pulled him up with the ropes and lifted him out of the cistern, but he continued to stay in the guard's courtyard.