Can someone explain this code?

CFrame’s have a function named toWorldSpace(ExampleCFrame) that returns a CFrame value that is converted to world space from object space. If you don’t know what object or world space are read Object and World Space article here and Understanding CFrames article here.

Moving onto the line with CFrame.Angles(0, math.rad(90), 0), CFrame.Angles() takes 3 rotation value arguments that must be in radians which is why math.rad() is used here so we can convert an angle in degrees to radians and use it in CFrame.Angles().

Other than this, there isn’t much math related stuff in this code.