Automatic country code detection is a great feature in forms. Forms are smart enough to recognize the location of the person that has accessed the page. The only action on your end is to ensure you're using a phone field in a form for this to apply.
Step 1: Using the Phone Field
Navigate to the Form Builder.
Create a new form or edit an existing form.
Utilizing the Standard Fields on the right-hand side, drag-and-drop the Phone field into the form.
Save the form.
Integrate the form.
Step 2: Viewing the Automatic Country Code Detection
Copy the link and visit the Form in a new browser tab.
You'll see the phone field has a country flag next to it. That flag should be the country you're physically located in, as the person accessing the form. (In the video and screenshot examples, it is USA.)