Define $F: \{f: X \to Y\}$. We will prove this with induction.
Base Case: If $|X| = 1$, then there is one element in X and n functions $f: X \to Y$ since the one element in X can be mapped to any of the |Y| elements in Y. Thus, $|F| = |Y|$. So, $|F| = |Y| = |Y|^{|X|} = |Y|^1$.
Induction step: Let $|X| = n$. Induction Hypothesis: Let $X$ and $Y$ be nonempty finite sets and let $F$ be the set of functions from $X$ to $Y$. Then, $|F| = |Y|^n$.
Induction Goal: Let $X$ and $Y$ be nonempty finite sets and let $F$ be the set of functions from $X$ to $Y$. Then, $|F| = |Y|^{(n+1)}$.
Since $X$ is a countable set, define an enumeration of $X$ as $X = \{x_1, x_2, ..., x_n+1\}$ where $n \in \mathbb{N}$. Then, since $X\setminus \{x_n+1\}$ is finite and $X\setminus \{x_n+1\} \to Y$, by the induction hypothesis there are $|Y|^n$ ways to write functions $f: X\setminus \{x_n+1\} \to Y$. The element $x_n+1$ in $X$ has exactly $|Y|^n$ choices for it to be sent to since it is a single element, as seen by the Base Case. So, functions from $X$ to $Y$ have $|Y|^n + |Y|^n$ choices for it to. Thus $|F| = 2*|Y|^n = |Y|^n+1$. Hence, by induction, $|F| = |Y|^|X|$ for all $|X| \geq 1$.
I sort of understand the logic but I am confused on creating the enumeration of $X$.
You're on the right track. Here's how I'd put it. If $|X|$ has $n + 1$ elements, fix some $x_0 \in X$ and define, for each $y \in Y$: $$S_y = \{f \in F : f(x_0) = y\}.$$ I would then define a bijection between $S_y$ and the set $F'$ of functions from $Y$ to $X \setminus \{x_0\}$ like so: $$\phi : F' \to S_y : f \mapsto \left(x \mapsto \begin{cases}f(x) & \text{if } x \neq x_0 \\ y & \text{if } x = x_0\end{cases}\right).$$ That is, $\phi(f)$ extends the domain of $f$ to all of $X$, by assigning the value $y$ at $x_0$. You can prove this is a bijection (I won't). Thus, $$|S_y| = |F'| = |Y|^n$$ for all $y \in Y$, by the induction hypothesis. You can also prove (I won't) that the $S_n$s partition $F$ (i.e. they union to give $F$, but are pairwise disjoint). This means that, $$|F| = \sum_{y \in Y} |S_y| = \sum_{y \in Y} |Y|^n = |Y| \cdot |Y|^n = |Y|^{n + 1} = |Y|^{|X|}.$$