Gary Williams battled depression following a split with his wife in 2018.
The 59-year-old said he “didn’t know what came over him” when he tried to break-in to the home in Bulphan on December 7 last year.
He was later arrested after Stanley knives and a Second World War bayonet were found near the home.
The weapons were recognised by Williams’ ex-wife, revealing he was the man trying to break in.
The couple were woken at around 2am with sounds of someone trying to break in downstairs through a window.
They confronted Williams who immediately fled the scene.
At Williams’ sentencing at Basildon Crown Court, Judge Andrew Hurst said: “Police attended and effectively you immediately indicated your guilt and you told the officers ‘I don’t know what I was thinking’.