Hi and welcome to the forums!
The instrument cluster is held in place by two torx screws which need removing, once removed, I would personally get a small suction pad attach it to the front of the cluster and pull it out towards you. Be careful there are three wires at the back which need to be disconnected. There are bulbs which likely need to be replaced around the area where the mileage and the trip is displayed.
Here is a video I found for the E36, the process should be similar for the Z3
View: https://youtu.be/csaO1GFTMDE
Re the rattle, as yours is a 97 prefacelift Z3 it's very common for the window regulator rivet to fail which needs welding back in place, if the rivet has fallen down the door that would explain the rattle you hear.
Here is what mine looked like
Usually if the rivet has failed though there will be other signs like the window not closing correctly all the way... Depending on how long it was left the regulator may need straightening out (if bent) or changing. I opted to change mine for peace of mind.