First, you need to subscribe to $50 monthly PLUS plan to have Class feature, other two plans don’t have the Class track.
You can turn this feature on by following these steps:
Click the Gear icon > Select Account and Settings > Go to the Advanced tab > Click on the Edit button for Categories > Check the Track classes box > Click on Save.
To add new classes:
Click the Gear icon > Select All Lists > Click on Classes > Click on New > Enter the class Name > Click on Save.
And then just start entering transactions and be sure to select Class. And you can run various reports by class in QBO.