You had the right start. We want to show that for any $\epsilon>0$, there exists an integer $N$ such that $\left|\frac{n}{n^2+1}-0\right| <\epsilon$ whenever $n>N$. Or alternately, we want to show that there is an $M$, not necessarily an integer, such that $\left|\frac{n}{n^2+1}-0\right| <\epsilon$ whenever $n>M$.
We solve the problem by producing a suitable $N$ (alternately, $M$).
So let $\epsilon>0$ be given. Note that if $n>0$ then
$\left|\frac{n}{n^2+1}-0\right|=\frac{n}{n^2+1}<\frac{n}{n^2}=\frac{1}{n}.$
So if we choose $n$ positive, it is enough to make sure that $\frac{1}{n}<\epsilon$. This inequality is easy to solve for $n$.
The inequality can be rewritten as $n >\frac{1}{\epsilon}$. It will hold if $n > \lceil \frac{1}{\epsilon}\rceil$. So we can choose, for example, $N=\lceil\frac{1}{\epsilon}\rceil$. Here by $\lceil x \rceil$ we mean the smallest integer which is $\ge x$.
Alternately and more simply, if $M=\frac{1}{\epsilon}$, then the desired inequality holds whenever $n>M$.
We have shown that given $\epsilon>0$, if we choose $N=\lceil\frac{1}{\epsilon}\rceil$, then $\left|\frac{n}{n^2+1}-0\right|<\epsilon$ whenever $n>N$. By definition we therefore have $\lim_{n\to \infty}\frac{n}{n^2+1} =0.$
Comment: There is no need to solve the inequality $\frac{n}{n^2+1}<\epsilon\:$ exactly. We are not being asked to find the cheapest $N$ such that if $n >N$, then the inequality holds. All we are asked to do is to show that there is such an $N$. It can be very helpful, in this case and elsewhere, to replace our expression $\frac{n}{n^2+1}$ by something which is guaranteed to be larger (but still approaches $0$), and is substantially simpler. In the solution we replaced $\frac{n}{n^2+1}$ by $\frac{1}{n}$. This saved us from the slightly painful task of solving a quadratic inequality.