Hello,
You need to go through the tutorials and references.
I did a project with the BNO055 and used quaternions:
https://discourse.processing.org/t/quaternions-and-euler-rotations-exploration/11262/1
This took some time, energy, research, perseverance and enthusiasm to code and I finally got there.
I am no longer sharing the code for this.
This was a useful resource for conversions:
https://www.euclideanspace.com/maths/geometry/rotations/conversions/index.htm
There are many examples on the Internet of such conversions and examples for these devices.
:)