There are two types of real numbers: rationals, which can be represented as fractions of the form $\frac{p}{q}$, where $p$ and $q$ are integers; and irrational numbers, which cannot be represented by the form $\frac{p}{q}$, with $p, q$ integers.
A consequence of this is that rational numbers have decimal representations that are either a.) terminating (e.g., $\frac14 = 0.25$) or b.) repeating, which means there is a pattern that repeats over and over again forever (e.g., $\frac{1}{7} = 0.142857142857142857\ldots$).
Now, there is a weird property of real numbers: between any two irrational numbers there is a rational number. And likewise, between any two rational numbers there is an irrational number.
This means that if you have any number $x$, either it is rational, or it is irrational. If $x$ is irrational, then there is no closest rational number to it! No matter what number we pick, we can always find another rational number closer to $x$.
Now, suppose we have a decimal expression that terminates. The easiest way to figure out its rational form is to keep multiplying by 10 to shift the decimal place over until there is nothing after the decimal place, then divide. For example, let's say $$x = 0.25.$$ Then, multiply by 10 until nothing is after the decimal place.
$$10x = 2.5 \\
100x = 25 \\
x = \frac{25}{100} = \frac14.$$
If the number is repeating, it's a little more complicated. Multiply by 10 until you have the entire pattern to the left of the decimal place. For example:
$$x = 0.142857142857\ldots\\
10x = 1.42857142857\ldots \\
\vdots \\
1000000x = 142857.142857\ldots$$
Now, notice that our new number is our finite pattern plus $x$, or in other words:
$$1000000 x = 142857 + x.$$
Now, subtract $x$ from both sides, and you get
$$1000000x-x = 999999x = 142857$$
so
$$x = \frac{142857}{999999}.$$
Now, you can simplify!