Drug addict Christopher Olokun, 32, murdered the 29-year-old during a botched robbery in Bethnal Green, east London, in August last year.
The Old Bailey heard how Hegarty, who worked for Stephen Davy Peter Smith Architects, was knifed in the heart as he tried to stop Olokun from taking his wallet and mobile phone.
Hegarty managed to tell passers-by he had been mugged, before collapsing.
An air-ambulance doctor performed open-chest surgery on Hegarty in a bid to restart his heart but he died in hospital five days later.
During the trial Olokun, who had been addicted to drugs since the age of 16, claimed the police had got the wrong man - saying he had been in a crack house at the time.
However, a witness at the hearing said Olokun had smoked crack cocaine and bragged about 'going hunting' prior to the attack.
Olokun went on to say he had killed Hegarty because 'the prick wouldn't give me his phone or his wallet'.
Olokun was ordered to serve a minimum of 25 years and was also found guilty of five other knife-point robberies - including one committed just a week before the killing.
Detective Chief Inspector Jim Condron said: 'This was an appalling, unprovoked and pointless murder which has had a devastating impact on Hegarty's family and friends.
'Bernard was a well loved and caring man who had a bright future ahead of him as a qualified and respected architect.'