How to make a push notification of a Chat?

Hello community, I have a question, I made a chat application, but how do I create a notification that the other person knows there is a new message? With the application closed? I know it can be done with the push notification component with the firebase and the one signal.

I use it so that I use the Onesignal extension and upload the UserID received there from Onesignal into my Firebase matching the user. If another user wants to write to this user, I only need the UserID of this user and then send a push message.