if you understand and acknowledge that your behavior was childish, then at least you are likely to be able to grow from this. unless they’re someone you can’t avoid (like a friend of family or project partner or something), give them space, learn from the situation, and move on. there will be other people.