"Put an end to" here is an idiom meaning to stop something. Alternate translation: "to stop the evil plan of Haman the Agagite" or "to prevent the evil things from happening that Haman the Agagite had planned" (See: [[rc://en/ta/man/jit/figs-explicit]])