Rishi Sunak has explained how he coped with constant criticism about his own wealth when he was prime minister.