How would you connect each black box once to each colored box without any lines overlapping, this is racking my brain so please help.
Note that you can move the boxes where ever you want.
Maybe there's some math trickery involved as I have spent hours trying to crack it but cannot seem to without having no option but to overlap (which I can't) or start again.
I am unsure if this is the correct forum to post in.

You can't do it without trickery. This is known as the three utilities problem and the graph you are trying to draw is $K_{3,3}$ which is known to be non-planar. The types of trickery used are to draw the graph on a torus or to say they are pipelines and one can go over another.