Commands and requests are reported with to + infinitive. First recognition, then transformation. From easy to hard.
For a negative command (with don't), there is a fixed order. Build the sentence in three steps – using "Don't be late." as an example:
Remember the order:
person + not + to + verb
He told me · not · to · be late.
Important: the "don't" from direct speech disappears completely. And "not" always comes BEFORE "to".
Special case "never": it stays and goes before "to" like "not": "Never give up." → She told me never to give up.