이/랑 vs 하고 vs 과
I just started learning Korean, and I am having trouble with distinguishing the difference between: ~이랑, ~랑, ~하고, and ~과.
Before coming to Duolingo, I was introduced to ~이랑 and ~랑, and it was said to use them in speaking. ~하고 and ~과 came up later and ~하고 was said to be used more often in writing rather than speaking, but it says otherwise on Duolingo?
Also, ~과 is supposed to be used when comparing, or showing a relationship between two things, but it is agreed that it is used more often in writing.
Can someone help me solidify these so I can put them in my notes correctly?