These two duas are Quranic duas. Both of these duas were said in times of great stress, in times where there was no hope left, when all hope of this world was cut off. One of the is the dua of Prophat Abraham (as). When Prophet Abraham was about to be thrown into the fire of namrood he made this dua, at just the tender age of 14 or 15 years old.
The second dua was that of the Prophet Yunus (As). At that time the Prophet Yunus (As) left the city without the permission of Allah. He got onto the boat to leave and during the middle of the night he as thrown off it. As we know Allah causes the whale to swallow him. He realised he make a mistake so he called out to Allah.