Check out example codes for "how to add a componet to a gameobject throgh code unity". It will help you in understanding the concepts better.
Code Example 1
//This uses C# and unity
//to add a ridgidbody
gameobject.addComponet<ridgidbody>();
//to add a meshCollider
gameobject.addComponet<MeshCollider>();
//check out my profile
Learn ReactJs, React Native from akashmittal.com