Try applying the rules for calculating oxidation states to carbon.
It’s going to feel a little bit weird. Why? Because there are two key differences.
First, carbon is often more electronegative (2.5) than some of the atoms it’s bound to (such as H, 2.2). So what do you do in this case?
Secondly, unlike metal-metal bonds, carbon-carbon bonds are ubiquitous. So how do you deal with them?