How do I convert a pre-existing site to a Composer-managed application?
Follow
https://www.drupal.org/docs/develop/using-composer/using-composer-to-manage-drupal-site-dependencies#managing-existing-site
Copy-paste method:  


Install Composerize Drupal with composer global require grasmash/composerize-drupal command;   
Run cd path/to/drupal/project/repo &amp;&amp; composer composerize-drupal
--composer-root=[repo-root]    --drupal-root=[drupal-root] where [composer-root] is the root directory of your project where .git is located and    [drupal-root] is the Drupal root where index.php is located.

Manually restructure pre-existing Drupal projects per discussion between Norman and Moshe on https://github.com/drush-ops/drush-launcher/issues/33
Rebuild the code base from scratch, see https://www.jeffgeerling.com/blog/2018/converting-non-composer-drupal-codebase-use-composer