How to group data in the 3D scatter graph?

I want to create a 3d scatter plot. But I dont know how to put data into different groups and put color for the group.
Any method to do it, please?