The easiest way to start is using the offcial example messaging app which can be found here. It is also documented on how to register a device and how to capture the device id, which will be used for sending notifications or managing device groups/topics.
Official documentation: https://firebase.google.com/docs/cloud-messaging/android/client.
An example application was also made available for iOS, which can be found on the official github repository.
Official documentation: https://firebase.google.com/docs/cloud-messaging/ios/client.