An online store can have several domains. One is always the primary domain, where others will be redirected.
Here's how you can choose the primary domain:
Go to Online store > Domain.
Choose the domain that you want to use as the primary domain.
Keep the old domain in use
If you need to change the primary domain, it's good to keep the old domain registered and attached to the store. Then it will redirect customers to the new domain automatically, and also, Google will know your online store's new address.
When you change the domain, it's also worthwhile checking Google's instructions on that subject.