Ahmed,
It is not a simple calculation to find the fan size. After much experience, you can do it by estimation. But to size the fan mathematically, you have to know how much heat must be removed, the temperature inside the cabinet, the ambient air temperature outside the cabinet, and the cooling characteristics of the fan.
Or you can look it up in a fan manufacturer's table of recommended fan sizes.
It is not a simple calculation to find the fan size. After much experience, you can do it by estimation. But to size the fan mathematically, you have to know how much heat must be removed, the temperature inside the cabinet, the ambient air temperature outside the cabinet, and the cooling characteristics of the fan.
Or you can look it up in a fan manufacturer's table of recommended fan sizes.