Hi Youssef,
there are a lot of examples and documentation out there to use a raspberry pi with Cumulocity IoT.
https://cumulocity.com/guides/device-tutorials/raspberry-pi-4/
https://thin-edge.github.io/thin-edge.io/html/tutorials/connect-c8y.html
and many more.