My younger brother had an imaginary friend after we moved to a new city. Our parents worried and kept telling him the friend wasn't real. I did the opposite.
I left an extra space at the table, asked what the imaginary friend thought, and occasionally blamed missing snacks on him. My brother eventually made real friends and forgot the imaginary one. He doesn't remember much of that period now. I do. He was lonely, and I think part of me was trying to make sure even his imaginary friend felt welcome.