Communicate from child to parent
CustomEvent can be used.
Check this for sample code and implementation - https://www.infallibletechie.com/2020/12/how-to-pass-data-from-child-to-parent.html
Communicate from Parent to Child
The @api decorator in the child component exposes a property, making it public, so that the parent component can update it.
Similarly, @api decorator function in child component can expose it as public to call it from the parent component.
Check this for sample code and implementation - https://www.infallibletechie.com/2020/12/how-to-pass-data-from-parent-to-child.html
Communicate between Unrelated Components
Lightning Message Channel can be used.
Check this for sample code and implementation - https://www.infallibletechie.com/2020/12/lightning-message-channel-in-salesforce.html