Poles are the roots of the characteristic equation (the denominator of the transfer function), so if you have a transfer function such as:
$$ G(s) = \frac{1}{s^2+a \cdot s+b} $$
That can also be rearranged to look like this,
$$ G(s) = \frac{1}{(s-s_1)(s-s_2)} $$
where \$s_1,s_2\$ are the poles of it.
You are correct that,
Now I know poles are points where the transfer function’s denominator is zero.
But, when you are inputing a sine/cosine to the system you should look at the response for the Fourier transform
$$ G(j\omega) = \frac{1}{(j\omega-s_1)(j\omega-s_2)} $$
where \$\omega = 2\pi \cdot f\$. Notice that, any of the poles can have the form \$ s_1 = x+ jy\$. So, a term of the form \$(j\omega-s_1)\$ will be able to "zero" the imaginary part of the pole, but not the real part, that will remain unchanged. That is why inputing the right frequency can result in a peak output but not a infinite one. Observe this, if the system can be represented as
$$ G(j\omega) = \frac{1}{(j\omega+a+j)(j\omega+a-j)} $$
and for,
$$ G(j) = \frac{1}{(a+j2)(a)} $$.
For a very small \$a\$, let say,
$$ a=0.001 -> G(j) \approx \frac{1}{(j2)(0.001)} = \frac{1000}{j2} $$.
These are cases where you have a peak, when the pole is very close to the imaginary axis. Then, by inputing the right frequency the output will have a big gain. But, if \$a\$ is large, such as
$$ a=100 -> G(j) = \frac{1}{(100+2j)(100)} \approx \frac{1}{10000} $$
there is no peak. At peak at a pole is discussed the same confusion on poles leading to a very big output. The resonant frequency happens when you have a pole on the the imaginary axis or very close to it, then the system tends to oscillate increasingly.
At slide 14 you can see a nice graph on the different behaviors that can be observed at the pole frequency, also, note that it is also explained the approximations usually used on bode plots. In these approximations, it is said that after a pole (as the frequency increases) the amplitude of the signal decreases 20dB/decade, while after a zero it increases 20dB/decade. But that is just an approximation! After all, the two examples I gave show the amplitude of the output for a signal with the frequency of the pole can either cause a peak or not.