You already answered it yourself
$$\bar{X}_n = \frac{X_1+...+X_i+...+X_n}{n}$$
$\bar{X}_n$ is a sample mean.
The subscript here refers to the sample size.
$X_i$ is a variable in the sample.
The subscript here refers to the id of the variable. The id's are the integers from 1 untill n.
An example is the image below of a Galton board (from Wikipedia Matemateca (IME/USP)/Rodrigo Tetsuo Argenton)
The distribution of the beads at the bottom is the distribution of an average (or sum) $\bar{X}$, where it relates to the sum of the movements of a bead through 5 duplicate layers of pins. Every double layer the beads will hit the pins and go straight with 50% chance, left with 25% chance, or right with 25% chance. You can see each double layer as a variable $x_i$ with possible values of $-1,0,1$ (relating to the movement of the bead). The bins at the end are the result of the sum of those $x_1+x_2+x_3+x_4+x_5$ and you can end up somewhere between $-5$ and $5$ (actually this board also has bins -6 and +6, it is not such a perfect process with only steps of -1, 0 or +1).
So you have
- $X_i$ the value of the movement of a bead in a particular (double) layer.
- $\bar{X}_5$ the sum of all the movements in the 5 double layers.
- The hundreds of beads in the bottom, which are different realisations of averaging/summing a sample of bead movements. The distribution of those beads will approximate a normal distribution when we increase the size of the Galton board.