The first step is understanding forms, and how forms work. The earlier versions of forms used http to send the form, resulting a response.
Given this was how forms work in the beginning, this is still the default behavior
Without understanding these fundamentals, you can’t progress to the next step
The next steps then would be:
prevent the form being send with http(s)
read the data from the input field
send the form using JS
Sure, I could tell you how all this could be done. But then you would just get stuck later on. You need to take some time to understand this process.