We don’t know - it’s never said.
Though the curse on the Defense Against the Dark Arts post is mentioned several times, and it’s made clear it’s there because of the Dark Lord being refused the post himself, it’s never explained exactly how the curse was cast on it.
“Was he after the Defence Against the Dark Arts job again, sir? He didn’t say …’
‘Oh, he definitely wanted the Defence Against the Dark Arts job,’ said Dumbledore. ‘The aftermath of our little meeting proved that. You see, we have never been able to keep a Defence Against the Dark Arts teacher for longer than a year since I refused the post to Lord Voldemort.”
- Harry Potter and the Half-Blood Prince, Chapter 20 (Lord Voldemort’s Request)
It is confirmed that there was indeed a curse, and the departure of the Defense Against the Dark Arts teacher each year wasn’t a coincidence, because JKR stated that the jinx on the teaching post broke because the Dark Lord was dead.
MV: Do you-- do Ron and Hermione or Harry ever return to Hogwarts in any capacity?
JKR: Well, I can well imagine Harry returning to give the odd talk on-- on Defense Against the Dark Arts. And-- I-- and, of course, the jinx is broken now because Voldemort's gone. Now they can keep a good Defense Against the Dark Arts teacher from here on in. So that aspect of the-of the wizarding education is now provided for.
- Today Show interview (July 26, 2007)
However, we don’t know anything about how the Dark Lord actually put the curse on the post. It’s also possible that he didn’t intentionally or knowingly curse the Defense Against the Dark Arts teaching post, but that his anger at not getting it caused ‘instinctive’ magic to curse it without him actually trying to. Even skilled wizards can cause things to happen through instinctive magic, especially in situations where their emotions are extreme.
“Do it! You have no idea of the danger we are in!’ shrieked Bellatrix: she looked frightening, mad; a thin stream of fire issued from her wand and burned a hole in the carpet.”
- Harry Potter and the Deathly Hallows, Chapter 23 (Malfoy Manor)
That would explain why he’s so willing to put his servants (Quirrell, Barty Crouch Jr., and Amycus Carrow) in the position, and why he never used a similar curse again on any other position like Headmaster of Hogwarts or the Aurors.