I tried the following but it doesn't work.
$index = 2;
$collection = [$item1, $item2, $item3];
$collection = [$item1, $item2, $item4, $item3];
The easiest way would probably be to splice it in, like this:
$collection = $collection->splice(2, 0, [$item4]);
Collections usually support the same functionality as regular PHP arrays. In this case, it's the array_splice() function that's used behind the scenes.
By setting the second parameter to 0, you essentially tell PHP to "go to index 2 in the array, then remove 0 elements, then insert this element I just provided you with".