The range is the horizontal distance a projectile traveles, we know that horizontally the motion of the porjectile is a rectilinear motion and it is described as:
To calculate the distance x we need to calculate the time the object will be in the air since this is the same time the object is moving horizontally, once we know it we can plug it on the equation above to find the range.