Resize overlapping parts to no longer overlap with a script?

Its mostly in the post, In this image you can see that the part hitboxes overlap, I’d simply like guidance to solve this problem

Do the parts have the same orientation? If not, do you know which axes are intersecting with each other?