I wrote a paper which got accepted in a reputed journal, I wrote another paper with completely different work, however when I submitted the second paper I mistakenly (actually I was in a hurry) with the old title (of accepted paper). What should I do now, should I withdraw my paper, or let the editor know about this, the paper is still in phase of "waiting for editor assignment" thankyou
Such errors are not uncommon. Just inform the journal through the editor in chief or wait until you actually have an editor. It is normally possible to change titles in any case up to the time of finalization.
At worst there will be a bit of confusion until you make the correction.
Although the question doesn't explicitly say so, I guess that the incorrect title is only in the web form for the submission, not on the paper itself. If that's correct, then I think you could just write to the editor: "Dear [editor's name], When I submitted my paper [correct title] for publication in [journal name], I mistakenly put an incorrect title [wrong title] on the web form. Could you please either correct that in the system or tell me how to correct it? Thank you, [your name]"
If, on the other hand, the paper itself had the wrong title (which I find hard to imagine), then your email to the editor should, in addition to explaining what happened, include an attachment with the correct version of the paper.