How to Find Degrees of Freedom: A Comprehensive Approach