Method to construct a finite state machine for a finite-size language L
Let $S$ be the list of all prefixes of words in $L$. Create a DFA with a state $q_s$ for each $s \in S$, and an additional sink state $q_\bot$. The starting state is $q_\epsilon$, and a state is accepting if it corresponds to a word in $L$. When at a non-sink state $q_s$, upon reading $\sigma$, move to $q_{s\sigma}$ if $s\sigma \in S$, and to $q_\bot$ otherwise. When at $q_\bot$, always stay there. 

To show that this works, prove inductively that when reading a word $w$, if $w \in S$ then the DFA is at state $q_w$, and otherwise it's at state $q_\bot$.