$\vec{s}=\vec{u}t+\frac{1}{2}\vec{a}t^2$
The above relation can be used for $x$-axis or y-axis separately, you just have to keep the vectors in your mind. This relation can be broken down into two components :
$s_x \hat{i} + s_y \hat{j}=(u\cos{\theta} \; \hat{i} + u\sin{\theta}\; \hat{j}) t + \frac{1}{2}(0\;\hat{i}+g\;(-\hat{j}))t^2$.
Things will be more clear if we separately compare the displacements along the two axes.
For $x$-axis :
$s_x =u\cos{\theta}\;t$ $\tag1$
The direction of all the vectors is the same and the projectile will only travel in a particular direction $(+\hat{i})$, so we can neglect the unit vectors and focus on the magnitude of the vectors. This is only for $x$-axis.
There will be no change in the horizontal component of the velocity, since there is no acceleration along $x$-axis to bring about that change. You increase the time, the displacement along $x$-axis will keep on increasing.
For $y$-axis :
$s_y.\hat{j}=u\sin{\theta}\;(\hat{j}) t-\frac{1}{2}g\;(\hat{j})t^2$. $\tag2$
In case of $y$-axis we have to consider the direction as well as the magnitude of the vectors, A projectile passes through the same height twice (except maximum height).
Range :
Range for a projectile is defined as the horizontal distance covered by the projectile in that time period (i.e., time of flight) in which the projectile remains in air (roughly speaking).
So, if you throw a projectile from the ground, the time of flight will be equal to the time that it takes for the projectile to attain the maximum height and again come back to the ground $(s_y=0)$.
And in this time, the horizontal distance covered by the projectile will be its range.
This time can only be found out by equation $(2)$, since we are considering displacement along $y$-axis to define the time of flight.
$s_y$ is $0$ at two instants, the initial instant when the projectile was thrown and the final instant when the projectile reaches the ground again.
We are interested only in the second case.
So, $T=\frac{2u\sin{\theta}}{g}$.
To find the range, you only have to put this value of time in equation $(1)$.