I need to select the country field with WooCommerce geolocation in the checkout field.
The user should still be able to change this.
How to do that? Thanks in advance.
Something is wrong in your installation as if you have choose the option in Woocommerce settings "General options" section for "Default customer location" as "Geolocate" (or "Geolocate with page caching support"), Woocommerce do that by default without any code needed. See:
Related threads for "Woocommerce Geolocation" on StackOver Flow.