We don't always know why some things happen to us nor do we always know where they came from. God is at work in the world but so is the devil, and we can't blame God for everything that happens to us.
Sometimes, in fact, we are responsible for the bad things that happen to us, because we make wrong decisions or deliberately turn our backs on God and His will for our lives. The Bible says, "When tempted, no one should say, 'God is tempting me.' For ... each one is tempted when, by his own evil desire, he is dragged away and enticed" (James 1:13-14).
But the most important thing I can tell you is this: No matter what happens to us, God is able to take it and use it for our good if we let Him. Joseph's brothers sold him into slavery and told his father he was dead but instead of being bitter or depressed, Joseph put his life into God's hands. As a result, God used him to save Egypt from famine. Later, after the brothers were reunited, Joseph told them, "You intended to harm me, but God intended it for good" (Genesis 50:20).
Begin by giving your life to Christ and asking Him to come into your heart. Then ask Him to give you the wisdom and strength you need to deal with your hard times. Most of all, ask Him to teach you through these experiences about His constant love.