Before interpreting the dreams of his companions in prison, H. Yoosuf AS (Prophet Joseph) spent a period of time in prison himself after being falsely accused of a crime. During his time in prison, he worked on gaining the trust and respect of his fellow inmates through his wisdom, patience, and character.