Former deputy prime minister Barnaby Joyce has revealed he wanted to die after his affair destroyed his career and marriage.

“When you stop thinking about how sad it will be when you have gone, to thinking, I have hurt so many that I want to go without anybody knowing,” he says in a new book, quoted by Fairfax Media on Tuesday.

In the book, Weatherboard and Iron, the married father of four admits pursuing women for years in Canberra before beginning an affair with his current partner, Vikki Campion, and having a baby boy.

At the time he ignored advice from his wife Natalie that he needed to seek help because their relationship was in serious trouble.

“Winston Churchill had his black dog. Mine was a half-crazed cattle dog, biting everything that came near the yard,” Mr Joyce writes in his book.

While he eventually did seek the help of a psychiatrist, who diagnosed him with depression, Joyce also sought solace by praying at a “special” rock he found on Canberra’s Red Hill.

Barnaby Joyce is seen speaking during a public general meeting organised by The Western Australian Farmers Federation.

Barnaby Joyce is seen speaking during a public general meeting organised by The Western Australian Farmers Federation.

AAP

Mr Joyce writes about how he gradually regained structure in his life thanks to his relationship with Campion, his former media advisor, and the birth of their son Sebastian in April.

He has dedicated his book to his four daughters and Sebastian, writing that he wished “I could have given you a life outside the spotlight I turned on you”.

“I wanted the best for you but was blinded in the glare of the exertion.”

Mr Joyce spent more than five years writing the book and says he decided to include the recent “salacious” details of his private life so people would buy it and also read his messages about rural Australia.

If you or someone you know needs help call Lifeline 13 11 14, please visit BeyondBlue at beyondblue.org.au or call 1300 22 4636.