How do i validate form with PHP and JS?

As it’s quite simple, I suggest you start by looking at HTML5 client-side validation as described here and elsewhere:
https://developer.mozilla.org/en-US/docs/Learn/Forms/HTML5_input_types

JavaScript validation is better if you wish to display your own error messages or if code is required to determine whether an input is valid.

At the server using PHP, it is important to sanitise the data received, especially if it is to go into a database. There was discussion in this forum thread on the use of FILTER_SANITIZE_STRING.