Show notification when a message is received

How can I implement notification system in my real time chat application? Exchanging notifications between devices when messages are sent and received. Any tutorial links will be appreciated. I’m using firebase.