I would recommend that you find a suitable tutorial about ideal versus real gas and how these are calculated. Here are two that found from a quick internet search:
https://www.khanacad...havior-of-gases
http://chemed.chem.p...deviation5.html
I would also expect that one of your textbooks would have a similar discussion of ideal versus real gases.
Both use the Van der Waals equation of state to illustrate how to compare ideal gases to real gases. Whether you stick with the VDW EOS or choose another, the basic concept is usually the same (especially when using the Peng-Robinson or Redlich Kwong or Soave EOS which are basically improvements on the VDW form).
Z factor (compressibility factor) is a simple measure of how different something is from an ideal gas. If an ideal gas is
PV/(nRT)=1, then a real gas can be described by how different PV/(nRT) is from 1. We, therefore, define compressibility as z=PV/(nRT).
With those resources, or similar resources, is there a specific part that you are having trouble understanding?