Newton's second equation of motion :-
S=ut+1/2at^2 [where, u is the initial velocity, a is the acceleration and t is the time interval]
This Equation simply finds a relation between distance travelled by a particle (classically) under uniform acceleration.
So let's see what pieces of information (bundles of equations) do we have with us, initially.
We have, a very primary equation with us,
dS/dt = v… (I)
(Considering motion in a straight line only)
And we also have the equation
dv/dt = a…(II)
Simply replacing the v in eqn (II) by eqn (I), we find
d2S/dt^2 = a…(III)
This is what we need to solve. It's easy.
You know,
d2S/dt^2 = d/dt(dS/dt) = a
⟹ dS/dt = ∫adt = at+c1
Since, dS/dt is the velocity of the particle,
Therefore, at t = 0, dS/dt|t = 0 = u
⟹ u = a∗0 + c1 = c1
⟹ c1 = u
Therefore, dS/dt = u + at
Thus, S = ∫(udt + atdt)
⟹ S = ut + 1/2at^2 +c^2
If say, the particle is already having a displacement S0 the moment you start measuring it's motion. Then, at t = 0, S = S0
This makes S = S0 +ut + 1/2at^2
Since, in most of the practical cases, we start measuring a motion when the particle starts displacing (i.e., when S0=0 ),
We get
S = ut + 1/2at^2
Hope it helps :)