This is an attempt to clarify the brief derivation of the Lorentz transformation in Albert Einstein’s book . Suppose that the speed of light, $c$, is the same regardless of whether a coordinate system is or is not translating with a nonzero speed.
Next consider two coordinates systems.
The first is called $K$ and the second is called $K’$.
The coordinates for $K$ are $x,y,z,t$ and the coordinates for $K’$ are $x’,y’,z’,t’$.
Let $K’$ be translating with respect to $K$ with a speed of $v$.
The direction of this translation of $K’$ is along the $x$-axis of $K$.
Suppose light flashes at the origin of both coordinate systems at $t=0=t’$.
The light then travels along the positive $x$-axis, positive $x’$-axis, negative $x$-axis, and the negative $x’$-axis.
In $K$ the position of the light is $X$, and the position of the light in $K’$ is $X’$.
Assume that $t$ and $t’$ increase from 0.

First consider the situation in $K$.
At time $t$, the position of the light along the positive $x$-axis is $X = ct.$
Similarly, the position of the light along the negative $x$-axis is
$X = -ct.$
These two equations give rise to
$0 = X – ct$
and
$0 = X + ct.$

A similar analysis can be done for $K’$.
The key point is that the speed of the light must be the same regardless of whether the coordinate system is translating with a nonzero speed or not.
So it must be true that, if $X’$ is the distance between the light and the origin of $K’$,
$X’ = ct’$
and
$X’ = -ct’$
Equations (4) and (5) give rise to
$0 = X’ – ct’.$
and
$0 = X’ + ct’.$
Note that equations (3) and (4) can be made more general with variables $\lambda$ and $\beta$:
$0 = \lambda (X – ct)$
and
$0 = \beta(X + ct).$

Since $0=0$, perhaps equations (7) and (9) are equal, and perhaps equations (8) and (10) are equal:
$X’ – ct’ = \lambda (X – ct)$
and
$X’ + ct’ = \beta(X + ct)$
These equations can be added and subtracted.
Let
$a \equiv \frac{\lambda + \beta}{2} \in \mathbb{R}$
and
$b \equiv \frac{\lambda – \beta}{2} \in \mathbb{R}.$
Then
$X’ = aX – bct$
and
$ct’ = act – bX.$

Option 1
First consider $t=0$.
Then equation (15) yields
$X’ = aX.$
Next consider $t’=0$ in $K’$.
Then equation (16) yields
$\frac{b c}{a} X = c^2 t = vX$
Define a velocity (see Appendix) as
$v \equiv \frac{bc}{a} \in \mathbb{R}.$
Constrain $v \ge 0$ to define the physical situation.
Since $c \ge 0$, $b$ and $a$ must now have the same sign.
Note that equation (17) yields
$\Delta X’ = a \Delta X$
and if $\Delta X’ = 1$ then
$\frac{1}{a} = \Delta X.$
Consider for general $t$ equation (15):
$X’ = aX – bct$
along with the previously derived equation with $t’=0$
$X = \frac{c^2}{v} t \rightarrow t = \frac{v}{c^2}X$
The previous two equations yield
$X’ = aX – b \bigg(\frac{v}{c}X \bigg)$
Suppose $\Delta X = 1$ from the perspective of $K’$ at $t’=0$.
Then
$\Delta X’ = a \bigg( 1 – \frac{v^2}{c^2}\bigg)$

By the principle of relativity the magnitudes of the displacements are equal, so using (21) and equation (25) one has:
$\bigg| \frac{1}{a} \bigg| = \bigg| a \bigg( 1 – \frac{v^2}{c^2} \bigg) \bigg|.$
Constrain $v\le c$ so that $\big( 1 – \frac{v^2}{c^2}\big) \ge 0$. Then
$a^2 = \frac{1}{1 – \frac{v^2}{c^2}}.$
Therefore,
$a = \pm \frac{1}{\sqrt{1 – \frac{v^2}{c^2}}}$
and
$a^2 v^2 = b^2 c^2 \rightarrow b^2 = \frac{a^2 v^2}{c^2}$
Therefore,
$b = \pm \frac{v}{c} \frac{1}{\sqrt{1 – \frac{v^2}{c^2}}}$
Finally, substitute $a$ and $b$ into equations (15) and (16).
$X’ = \pm \frac{1}{\sqrt{1 – \frac{v^2}{c^2}}}X – \pm \frac{v}{c} \frac{1}{\sqrt{1 – \frac{v^2}{c^2}}}ct$
and
$ct’ = \pm \frac{1}{\sqrt{1 – \frac{v^2}{c^2}}}ct – \pm \frac{v}{c} \frac{1}{\sqrt{1 – \frac{v^2}{c^2}}}X.$
Choose the positive roots.
$\boxed{ X’ = \frac{X – vt}{\sqrt{1 – \frac{v^2}{c^2}}}}$
and
$\boxed{ t’ = \frac{t – \frac{v}{c^2} X }{\sqrt{1 – \frac{v^2}{c^2}}} }.$

Option 2
First consider $t=0$. Then
$X’ = aX$
or $\Delta X’ = a \Delta X.$
Suppose $\Delta X = 1$.
Then
$\Delta X’ = a.$
Next consider $t’=0$.
Then equation (16) yields
$bX = act.$
Define a velocity $v \equiv \frac{bc}{a} \in \mathbb{R}$ (see Appendix). Constrain $v \ge 0$ to define the physical situation.
Since $c \ge 0$, $b$ and $a$ must now have the same sign.
Then
$v X = c^2 t$
or
$t = \frac{vX}{c^2}.$
For general $t$ equation (15) is
$X’ = aX – bct$
Substitute the result from $t’=0$ to obtain
$X’ = a X \bigg( 1 – \frac{v^2}{c^2} \bigg)$
Hence
$\Delta X’ = a \Delta X \bigg( 1 – \frac{v^2}{c^2} \bigg)$
Suppose that $\Delta X’ = 1$.
Then
$1 = a \Delta X \bigg( 1 – \frac{v^2}{c^2} \bigg)$
or
$\frac{1}{a\big( 1 – \frac{v^2}{c^2} \big)} = \Delta X$

From the principle of relativity the magnitudes of the displacements are equal:
$\bigg| \frac{1}{a\big( 1 – \frac{v^2}{c^2} \big)} \bigg| = |a|.$
Constrain $v\le c$ so that $\big( 1 – \frac{v^2}{c^2}\big) \ge 0$. Then
$\frac{1}{ 1 – \frac{v^2}{c^2} } = a^2.$
Since
$v^2 = \frac{b^2 c^2}{a^2} \rightarrow \frac{v^2 a^2}{c^2} = b^2$
one has
$b = \pm \frac{v }{c} a = \pm \frac{v }{c} \frac{1}{\sqrt{1 – \frac{v^2}{c^2}}}.$
since, from (47), one has
$a = \pm \frac{1}{\sqrt{1 – \frac{v^2}{c^2}}}.$
Finally, substitute $a$ and $b$ back into equations (15) and (16):
$X’ = \pm \frac{1}{\sqrt{1 – \frac{v^2}{c^2}}}X – \pm \frac{v }{c} \frac{1}{\sqrt{1 – \frac{v^2}{c^2}}}ct$
and
$ct’ = \pm \frac{1}{\sqrt{1 – \frac{v^2}{c^2}}}ct – \pm \frac{v }{c} \frac{1}{\sqrt{1 – \frac{v^2}{c^2}}} X.$
Choose the positive roots.
$\boxed{ X’ = \frac{X – vt}{\sqrt{1 – \frac{v^2}{c^2}}} }$
and
$\boxed{ t’ = \frac{t – \frac{v}{c^2} X}{\sqrt{1 – \frac{v^2}{c^2}}} }.$

Appendix

Recall that
$X’ = aX – bct.$
Divide by $a$:
$\frac{1}{a} X’ – X = – \frac{bc}{a} t$.

Suppose $X’=0$.
Then, since
$X = \frac{bc}{a} t = vt$
one has
$\frac{\Delta X}{\Delta t} = v$

Alternatively, suppose $X=0$. Then equation (15) yields
$X’ = -bct$
while equation (16) yields
$\frac{1}{a}t’ = t .$
Substituting $t = \frac{t’}{a}$ into $X’ = -bct$ one obtains
$X’ = -bc \frac{t’}{a}$
$\Delta X’ = – \frac{bc}{a} \Delta t’$
or, with $v \equiv \frac{bc}{a}$,
$\frac{\Delta X’}{\Delta t’} = -v.$