Here are some good notes by Shankar from Yale Open Courses
https://oyc.yale.edu/sites/default/files/relativity_notes_2006_5.pdf
video:
https://oyc.yale.edu/physics/phys-200/lecture-12
Might be of use for you if you want to start from the postulate "speed of light is same in all inertial systems" and then derive the invariance of the space-time interval.
Consider frame ##\tilde S## moving in ##S## with velocity ##v## in the ##+x## direction.
From the
galilean transformation the relationship between coordinates ##(x,t)## and ##(\tilde x, \tilde t)## are
##\boxed{t = \tilde t}##
##\boxed{ \tilde x = x - vt \: , \, x = \tilde x + v t}##
But with this transformation, you will get that the speed of light is not the same in ##S## and ##\tilde S## (which Michelson–Morley experiment and Maxwells equations suggested).
Consider instead a more general linear transformation (linear - it is invertible, one coordinate in ##\tilde S## will correspond to exactly one coordinate in ##S##) which is called
Lorentz transformation:
##
\boxed{ \tilde x = \gamma (x-vt) } \: (1)
\qquad
\boxed{ \tilde t = \gamma \left( t - \dfrac{xv}{c^2} \right) }\qquad
\boxed{ x = \gamma (\tilde x + v\tilde t) } \: (2)
\qquad
\boxed{ t = \gamma \left( \tilde t + \dfrac{\tilde x v}{c^2} \right) }
##
where ##\gamma## is a factor which should only depend on ##v## which shall fulfill ##\gamma \to 1## when ##v/c \to 0## which motivates the Galilean transformation as "low speed limit" (I know, there was
a recent thread about this which is pretty good read!) and it should give that the speed of light is the same in both ##S## and ##\tilde S##.
That speed of light should be the same in both ##S## and ##\tilde S## is implemented as follows:
When the origins of ##S## and ##\tilde S## coincide, a ray of light is emitted. The position of the front of the ray is ##x = ct## in ##S## and ##\tilde x = c\tilde t## in ##\tilde S##. Insert ##t = x/c## into the Lorentz-transformation for ##\tilde x## (1) and ##\tilde t = \tilde x/c## into the Lorentz-transformation for ## x## (2).
We get ##
\tilde x = \gamma \left(x-v\dfrac{x}{c}\right)= \gamma \left(1- \dfrac{v}{c}\right) x
##
and
## x = \gamma \left(\tilde x+v\dfrac{\tilde x}{c}\right)= \gamma \left(1+ \dfrac{v}{c}\right) \tilde x ##
which means that ## \dfrac{\tilde x}{x} = \gamma \left(1- \dfrac{v}{c}\right) ## and ## \dfrac{\tilde x}{x} = \dfrac{1}{\gamma \left(1+ \dfrac{v}{c}\right)}##
solve for ##\gamma##, the result is ##\boxed{ \gamma = \dfrac{1}{\sqrt{1 - \frac{v^2}{c^2}}} }##.
Now consider the quantity ##s^2 = (ct)^2 - x^2##. By performing the Lorentz-transformation above, we obtain
## s^2 = (ct)^2 - x^2 = \dfrac{c^2\left(\tilde t + \frac{\tilde x v}{c^2}\right)^2}{1-\frac{v^2}{c^2}} - \dfrac{\left(\tilde x + v\tilde t\right)^2}{1-\frac{v^2}{c^2}} = \dfrac{c^2 \tilde t ^2 + 2 \tilde t \tilde x v+ \frac{\tilde x^2 v^2}{c^2} - \tilde x^2 - 2 \tilde t \tilde x v - v^2 \tilde t^2 }{1-\frac{v^2}{c^2}} = ##
##\dfrac{(c^2-v^2)\tilde t^2}{1-\frac{v^2}{c^2}} - \dfrac{\left(1 - \frac{v^2}{c^2}\right)\tilde x^2}{1-\frac{v^2}{c^2}} = \dfrac{c^2\left(1-\frac{v^2}{c^2}\right)\tilde t^2}{1-\frac{v^2}{c^2}} - \tilde x^2 = c^2 \tilde t^2 - \tilde x^2 = (c\tilde t)^2 - \tilde x^2 = \tilde s^2##
Conserved / invariant quantities are very important in physics since they hint that there is some underlying geometrical property, symmetry.
Now there are plenty of other invariant quantities in special relativity (such as the invariant mass) which can be proven to be so following a smilar calculation as above. But, it is much nicer to work with four-vector formalism.