Since I spent all morning throwing up today this question came to my mind.

I already know that in Heaven there will be no more sickness and pain, but why do we get sick in the first place? Is sickness caused by Satan, or is it just because how the world works? Possibly even both. Btw, I'm feeling a lot better now for the record. :) (Otherwise I wouldn't be here right now typing this lol)
The Scriptures attributed to devils some sicknesses. In the OT, the Law indicated that disobedient Israelis would come under a curse. Some of that curse was, at times, satanic oppression. For example, King Saul, due to his continuous rejection of God's word, came under demonic oppression. The Spirit of God, operating through David's music, helped, just like drugs may help today.
Jesus also healed Israelis in his day who were afflicted with various illnesses, some of them attributed to the Devil. It certainly doesn't mean all illnesses were caused by the Devil. Nor did it mean those afflicted were always guilty of some sin, though some were.
It would be a big mistake, then, to refer all sickness and trouble to the Devil. The Devil isn't omnipresent, and he isn't God. He seems to be everywhere, because his compatriots, the fallen spirits, are everywhere. However, they aren't God collectively, either. They only have the ability to do what God lets them do.
God sometimes afflicts the righteous with trouble because they are given to live in a particular environment, being witnesses to the love of God where God has placed them. We are here to offer salvation to the lost. We have to hold out God's love to them in the fallen environment in which mankind was sent.
Sometimes we are infected by a flu due to our living in an environment afflicted by a pandemic, or we live in a family where a contagious disease exists. Getting an infectious disease could be a judgment from God against us, to discipline us, or it may simply be a way for us to show God's grace towards those responsible for sending the disease our way!
God of course can prevent the spread of illness, but He doesn't always spare the righteous from suffering the impact of the ungodly. Christ suffered not for his own sins but for the sins of those around him. We also have to suffer some in the fallen world, which is full of trouble. Jesus said we'd have limited trouble every day.
When you get sick, examine yourself to see if there is anything displeasing to God in your life. Don't look too hard. God loves you and is more patient than we are. If you don't see anything obvious, write the trouble off to God wanting you to endure some of the pains of this world, to testify to God's patience and love. He endured pain, but He remained willing to love, to forgive, and to be patient. Good question!