How to remove the vertical space between two images latex

You can combine the contents of the separate figure environments into one:

\begin{figure}[htb]
  \centering
  \includegraphics[scale=0.37]{Cube.png}

  \vspace{<whatever>}

  \includegraphics[scale=0.37]{Cog.png}
\end{figure}

Now you can supply a space of <whatever> to adequately separate the images. If you don't want any space, just remove the \vspace command but keep an empty line between the two included images. Some suggestions:

  • The [H] float specifier (from the float package) doesn't help here, since you're keeping things together anyway. For more on float placement, see How to influence the position of float environments like figure and table in LaTeX?;
  • Scaling an inserted image using scale is okay. However, in most cases it's better to use a width or height key-value. This way you can ensure the two images are of the same size. Use, for example, width=0.5\linewidth.