A man who beat the odds after suffering a cardiac arrest in 2023 had the chance to thank those who gave him a second shot at life.