Everything we know about the husband of Mary and the foster father of Jesus comes from Scripture.
We know he was a carpenter, a working man, for the skeptical Nazarenes ask about Jesus, "Is this not the carpenter's son?" (Matthew 13:55). He wasn't rich for when he took Jesus to the Temple to be circumcised and Mary to be purified he offered the sacrifice of two turtledoves or a pair of pigeons, allowed only for those who could not afford a lamb (Luke 2:24).
Despite his humble work and means, Joseph came from a royal lineage. Luke and Matthew disagree some about the details of Joseph's genealogy but they both mark his descent from David, the greatest king of Israel (Matthew 1:1-16 and Luke 3:23-38). Indeed the angel who first tells Joseph about Jesus greets him as "son of David," a royal title used also for Jesus.
We know Joseph was a compassionate, caring man. When he discovered Mary was pregnant after they had been betrothed, he knew the child was not his but was as yet unaware that she was carrying the Son of God. He planned to divorce Mary according to the law but he was concerned for her suffering and safety. He knew that women accused to adultery could be stoned to death, so he decided to divorce her quietly and not expose her to shame or cruelty (Matthew 1:19-25).
We know Joseph was man of faith, obedient to whatever God asked of him without knowing the outcome. When the angel came to Joseph in a dream and told him the truth about the child Mary was carrying, Joseph immediately and without question or concern for gossip, took Mary as his wife. When the angel came again to tell him that his family was in danger, he immediately left everything he owned, all his family and friends, and fled to a strange country with his young wife and the baby. He waited in Egypt without question until the angel told him it was safe to go back (Matthew 2:13-23).
We know Joseph loved Jesus. His one concern was for the safety of this child entrusted to him. Not only did he leave his home to protect Jesus, but upon his return settled in the obscure town of Nazareth out of fear for his life. When Jesus stayed in the Temple we are told Joseph (along with Mary) searched with great anxiety for three days for him (Luke 2:48). We also know that Joseph treated Jesus as his own son for over and over the people of Nazareth say of Jesus, "Is this not the son of Joseph?" (Luke 4:22)
We know Joseph respected God. He followed God's commands in handling the situation with Mary and going to Jerusalem to have Jesus circumcised and Mary purified after Jesus' birth. We are told that he took his family to Jerusalem every year for Passover, something that could not have been easy for a working man.
Since Joseph does not appear in Jesus' public life, at his death, or resurrection, many historians believe Joseph probably had died before Jesus entered public ministry.
Joseph is the patron of the dying because, assuming he died before Jesus' public life, he died with Jesus and Mary close to him, the way we all would like to leave this earth.
There is much we wish we could know about Joseph -- where and when he was born, how he spent his days, when and how he died. But Scripture has left us with the most important knowledge: who he was -- "a righteous man" (Matthew 1:18).