I'm reading Limits In Category Theory by Scott Messick, and trying to understand the formula on page 8, for Theorem 5.2, which states: Let $F : \mathscr{J} \to \mathbf{Set}$ be any small diagram in $\mathbf{Set}$. Then the limit of $F$ is the set
$$L = \lim_{i \in \mathscr{J}} F(i) = \{(x_i) \in \prod_{i \in \mathscr{J}} F(i) || (F f)(x_i) = x_{cod f} \forall f \in Ar(\mathscr{J})\}$$
I'm having trouble keeping track of all the $x$'s, and their various subscripts. As I understand it, this formula says the limit of any small diagram in $\mathbf{Set}$ is equal to a subset of the product (cartesian product of sets) of the elements in $\mathbf{Set}$ indicated by the diagram. This is the given by the first part of the formula, $\{(x_i) \in \prod_{i \in \mathscr{J}} F(i)\}$. The second part is the condition for an element of the product to be part of the limit object. I'm not entirely sure what $(F f)(x_i)$ is referring to though. It seems to me that $x_i$ should be an element of the product (as given by $x_i \in \prod_{i \in \mathscr{J}}$). This element, however, can't be applied to $(F f)$, which should be a morphism (function) from one component object (set) of the product, to another component set. Does $x_i$ actually refer to an member of one of these elements of the product? Or does $x_i$ mean something different in the condition part?
The paper also states that an equivalent condition is
$$(F f)(x_i) = (F g)(x_j), \text{whenever } f, g \in Ar(\mathscr{J}) \text{and } cod f = cod g$$
This seems to suggest that the subscript $i$ in $x_i$ isn't related to the elements of the diagram $F(i)$, since $x_i$ and $x_j$ appear to be elements of 2 objects in $\mathbf{Set}$, when the $j$ subscript hasn't even been used before.
When we write $(x_i)\in\prod_{i \in \mathscr{J}}F(i)$, we mean that $(x_i)$ is a tuple, indexed by the variable $i$. That is, we really are speaking of a function $i\mapsto x_i$ which takes an object $i\in\mathscr{J}$ and gives us an element $x_i$ in the set $F(i)$. So for any particular fixed $i$, $x_i$ is an element of $F(i)$ (and in particular, $x_i$ is very different from the entire tuple $(x_i)$; in the tuple, "$i$" is really just serving as a dummy index variable).
Let's now talk about $(Ff)(x_i)$. Here the definition is actually stated incorrectly: the condition should be that for all $i$ and $j$ and all morphisms $f:i\to j$ in $\mathscr{J}$, $(Ff)(x_i)=x_j$. This makes sense, because $Ff$ is a function from $F(i)$ to $F(j)$, $x_i$ is an element of $F(i)$, and $x_j$ is an element of $F(j)$. Here $j$ is what the definition calls "$codf$", since it is the codomain of $f$. But the definition as you stated it doesn't make sense, since it never specifies that the domain of $f$ is supposed to be $i$, so that it makes sense to evaluate $(Ff)(x_i)$.
Again, in the "equivalent condition" you state, it should be clarified that $i$ is the domain of $f$ and $j$ is the domain of $g$, so that the evaluations $(Ff)(x_i)$ and $(Fg)(x_j)$ make sense (and then they are both elements of $F(k)$, where $k$ is the common codomain of $f$ and $g$).
To understand this definition more intuitively, you can just note that the set being described is exactly the set of cones over your diagram from a singleton set $\{*\}$. Indeed, a cone from $\{*\}$ consists of a map $\{*\}\to F(i)$ for each $i$ (that is, an element $x_i\in F(i)$), such that for each $f:i\to j$ in the category $\mathscr{J}$, the composition $\{*\}\to F(i)\stackrel{Ff}{\to} F(j)$ is equal to our map $\{*\}\to F(j)$ (that is, $(Ff)(x_i)=x_j$). So if a limit of the diagram exists, maps from $\{*\}$ to the limit must be in bijection with the set we're describing. But maps from $\{*\}$ to a set are just points of the set. So this shows that if the limit exists, it must look like the set we're describing; it then takes a bit more work to show that this set actually is a limit.