//toadd a new ridgidbody
gameobject.AddComponent<Rigidbody>();
//toadd a new meshCollider
gameobject.AddComponent<MeshCollider>();
//Original answer by MakerBenjammin6, cleanup by me.
//Use the AddComponent<T>() Method to add a component to your gameobject
GameObject gameObject;
gameObject.AddComponent<BoxCollider>(); //Component has to be an actual Unity component
//This uses C# and unity
//toadd a ridgidbody
gameobject.addComponet<ridgidbody>();
//toadd a meshCollider
gameobject.addComponet<MeshCollider>();
//checkout my profile