He is however confident that Pakatan Rakyat will win in the next polls.
Anwar was once deputy prime minister in the Barisan Nasional government that has ruled Malaysia since independence 55 years ago, but has campaigned against it since his shock ouster in 1998.
Najib must call national elections by June next year and many observers expect a tight contest after the ruling coalition suffered its worst showing ever at the last polls in 2008.
“I will try my best. I am confident we will win. But if not, I will step down,” Anwar said Friday night when taking part in a Google Hangout that was streamed live on YouTube.
Anwar, who has taught at Oxford and Washington’s Georgetown University, said he would return to academic life if he lost.
“If we don’t get the mandate, then we should give space for the second-liners in leadership,” he said during the one-hour question-and-answer event which has previously featured US President Barack Obama.
Anwar has been in and out of court on various charges he says are political ploys to tarnish his image and stifle his opposition coalition.
He was charged in May with participating in an illegal rally which saw tens of thousands take to the streets to call for reforms to the electoral system, which they say is biased towards the Barisan Nasional.
In January he was acquitted of having sex with a male former aide at the end of a lengthy trial.
Previously, Anwar was imprisoned for corruption and sodomy after he fell out with the then prime minister Dr Mahathir Mohamad in 1998.
He was released from jail in 2004 after the sodomy conviction was overturned.