AddComponent

hello everyone, can someone tell me how to use the function addComponent and addComponentByClass