Line Deleting

I edited the lines on OpenStreetMap, I found that it has some points go wrong. I retrace the new line (Not to edit the old one), and wants to delete the old one, how to do?
Thank you for your suggestion.

Hi and welcome to OSM and the forum

First, a general advise before delting objects in OSM:
Please try to keep ways (lines) before consider retrace and deleting. The object may have a long and deep history. This information will vanish by deleting the object! Also the object may be part of a relation. By deleting and retracing you need to make sure that your new object is a memeber of the relation.

Regarding your question: Press D in JOSM to delete objects. Don’t know if this is the same in other editors.