Is this the correct way to add post-slug input field?

If the slug exsit WordPress will add a number to the end. For example if you had two post named “test” you would get “test” and “test-1”

Hope that helps