We have indeterminateness of type
0/0,
i.e. limit for the numerator is
$$\lim_{x \to 0^+}\left(x^{2} + 2 x - \sqrt{4 x + 1} + 1\right) = 0$$
and limit for the denominator is
$$\lim_{x \to 0^+}\left(- e^{x^{2}} + \cos{\left(x \right)}\right) = 0$$
Let's take derivatives of the numerator and denominator until we eliminate indeterninateness.
$$\lim_{x \to 0^+}\left(\frac{\left(x + 1\right)^{2} - \sqrt{4 x + 1}}{- e^{x^{2}} + \cos{\left(x \right)}}\right)$$
=
Let's transform the function under the limit a few
$$\lim_{x \to 0^+}\left(\frac{\left(x + 1\right)^{2} - \sqrt{4 x + 1}}{- e^{x^{2}} + \cos{\left(x \right)}}\right)$$
=
$$\lim_{x \to 0^+}\left(\frac{\frac{d}{d x} \left(x^{2} + 2 x - \sqrt{4 x + 1} + 1\right)}{\frac{d}{d x} \left(- e^{x^{2}} + \cos{\left(x \right)}\right)}\right)$$
=
$$\lim_{x \to 0^+}\left(\frac{2 x + 2 - \frac{2}{\sqrt{4 x + 1}}}{- 2 x e^{x^{2}} - \sin{\left(x \right)}}\right)$$
=
$$\lim_{x \to 0^+}\left(\frac{\frac{d}{d x} \left(2 x + 2 - \frac{2}{\sqrt{4 x + 1}}\right)}{\frac{d}{d x} \left(- 2 x e^{x^{2}} - \sin{\left(x \right)}\right)}\right)$$
=
$$\lim_{x \to 0^+}\left(\frac{2 + \frac{4}{4 x \sqrt{4 x + 1} + \sqrt{4 x + 1}}}{- 4 x^{2} e^{x^{2}} - 2 e^{x^{2}} - \cos{\left(x \right)}}\right)$$
=
$$\lim_{x \to 0^+}\left(\frac{2 + \frac{4}{4 x \sqrt{4 x + 1} + \sqrt{4 x + 1}}}{- 4 x^{2} e^{x^{2}} - 2 e^{x^{2}} - \cos{\left(x \right)}}\right)$$
=
$$-2$$
It can be seen that we have applied Lopital's rule (we have taken derivatives with respect to the numerator and denominator) 2 time(s)