What you need is a switch. Make sure it support TRRS as a lot of them are TRS (headphone) only. Example: https://www.amazon.com/Sonshine-Electronics-Speaker-Headphones-selector/dp/B09RWB4SZR/ref=sr\_1\_2?crid=1LPA7AYM87UO&keywords=sonshine&qid=1683993705&sprefix=sunshine%2Caps%2C142&sr=8-2