Assume $x>0$ and irrational. If $x$ is rational, define $x_n:=x$ for all $n$.
Let $a_n:=\left\lfloor x10^n\right\rfloor$ and define $b_n:= \left\lfloor 10^{n} x-10a_{n-1}\right\rfloor$. And finally $x_n:=\sum\limits_{k=0}^{n} \frac {b_k}{10^k}$. Basically I'm truncating $x$ to $n$ decimals at the $n$'th term in the sequence.
The breakdown:
We will write $x=b_0\cdot b_1 b_2 b_3 \ldots\;$, where $b_i \in\{0,1,2,\ldots,9\}$ for each $i \in \mathbb{N}$ and $b_0 \in \Bbb{N}_0$, with the convention that there does not exist an $N \in \Bbb{N}_0$ such that for all $i> N$ we have $b_i=9$. We do this to rule out ambiguities like $1=0.\dot{9}$
How you might write $x$ as a decimal is kinda the above method unless you know something special about the number. We want the $n$'th digit so we compute $a_{n-1}$ and $\lfloor 10^n x \rfloor$, and plug it into $b_n$ above. ($b_n$ also equal $\lfloor 10^n x\rfloor-10a_{n-1}$ because the second term is an integer less than or equal to the first term)
To show this works, suppose we have the decimal expansion as above.
$a_n=\left\lfloor x10^n\right\rfloor=\left\lfloor b_0 b_1 b_2 b_3 \ldots b_n\cdot b_{n+1}b_{n+2}\ldots\; \right\rfloor=b_0 b_1 b_2 b_3 \ldots b_n$ as a decimal number, not multiplied.
Then we have that
$\left\lfloor 10^{n} x-10a_{n-1}\right\rfloor=\left\lfloor b_0 b_1 b_2 b_3 \ldots b_n\cdot b_{n+1}b_{n+2}\ldots\;-b_0 b_1 b_2 b_3 \ldots b_{n-1} 0\right\rfloor=\left\lfloor b_n\cdot b_{n+1}b_{n+2}\ldots\;\right\rfloor$
which is just $b_n$. So we now know the $n$'th digit, so we more or less say what we started with, that $$x=\sum\limits_{k=0}^{\infty} \frac {b_k}{10^k}=b_0\cdot b_1 b_2 b_3 \ldots\;$$
and we just take the partial sums, which are finite sums of rationals and so are rational:
$$x_n:=\sum\limits_{k=0}^{n} \frac {b_k}{10^k}=b_0\cdot b_1 b_2 b_3 \ldots b_n\dot0\;$$
Also then $|x-x_n|<\large\frac{1}{10^n}$.