Programmatically:
How to associate simple products to the configurable product without creating configurable product, because it exists.
Magento 2 – Associate Simple Products to Configurable Products Programmatically
associated-productsconfigurable-productmagento2simple-product
Best Answer
I found the solution:
Load product configurable by ID:
Load product configurable by SKU: