James 1:2-3 is very clear on this - trials (bad things) are used by God to perfect you.
Consider it pure joy, my brothers and sisters, whenever you face trials of many kinds, because you know that the testing of your faith produces perseverance. Let perseverance finish its work so that you may be mature and complete, not lacking anything.
Temptation, often a related concept, however, is not from God, per verses 13-15:
When tempted, no one should say, “God is tempting me.” For God cannot be tempted by evil, nor does he tempt anyone; but each person is tempted when they are dragged away by their own evil desire and enticed. Then, after desire has conceived, it gives birth to sin; and sin, when it is full-grown, gives birth to death
As Hebrews 12 reiterates this, saying:
have you completely forgotten this word of encouragement that addresses you as a father addresses his son? It says,
“My son, do not make light of the Lord’s discipline,
and do not lose heart when he rebukes you,
because the Lord disciplines the one he loves,
and he chastens everyone he accepts as his son.”
Finally, from 1 Corinthians 10:13 it is clear that when these bad things occur, God promises to give you strength to overcome them
No temptation has overtaken you except what is common to mankind. And God is faithful; he will not let you be tempted beyond what you can bear. But when you are tempted, he will also provide a way out so that you can endure it.
In the Greek, the understanding of trials and temptations can be understood to represent the bad circumstances of life that strengthen an individual.