Answer
The line $y=a$ is a horizontal asymptote of the graph of the function $y=f(x)$ if either $\lim_{x\to\infty}f(x)=a$ or $\lim_{x\to-\infty}f(x)=a$
The line $x=a$ is a vertical asymptote of the graph of the function $y=f(x)$ if either $\lim_{x\to a^+}f(x)=\pm\infty$ or $\lim_{x\to a^-}f(x)=\pm\infty$
Work Step by Step
1) Horizontal asymptote:
The line $y=a$ is a horizontal asymptote of the graph of the function $y=f(x)$ if either $\lim_{x\to\infty}f(x)=a$ or $\lim_{x\to-\infty}f(x)=a$
For example, function $y=f(x)=\frac{1}{x}$
As $x\to\infty$ and $x\to-\infty$, $f(x)=1/x$ both approaches $0$. Therefore, $\lim_{x\to\infty}f(x)=0$. So $y=0$ is the horizontal asymptote of the function.
2) Vertical asymptote:
The line $x=a$ is a vertical asymptote of the graph of the function $y=f(x)$ if either $\lim_{x\to a^+}f(x)=\pm\infty$ or $\lim_{x\to a^-}f(x)=\pm\infty$
For example, function $y=f(x)=\frac{1}{x}$
As $x\to0$, $f(x)=1/x$ approaches $\infty$. Therefore, $\lim_{x\to0}f(x)=\infty$. So $x=0$ is the vertical asymptote of the function.