How to write a letter to an editor for pointing out needed corrections in my submitted journal manuscript
Yes, you should inform the editor.  Simply resend the  corrected paper, and explain the error.  There is no need to write an extensive letter or to make a grand apology. Something like this in an email will do fine:

"Dear Editor,

I am sending you a corrected copy of the paper titled '...', submitted on XX.  There were errors on pages A, B, and C in the citations.  They appeared as "?" instead of the correct citation, due to incorrect processing in LaTex.  This version has the correct citation and I have proof read it for other errors.

Best regards,

Monalisa"

Also - give the file a different name than the original and a different time stamp so there is no confusion between the corrected version and the original.