Making an input field required from WP’s perspective

I believe yo are looking for wp_die which will Kill WordPress execution and display HTML message with error message.

But the codex says:

It is not recommended to call this function very often and try to handle as many errors as possible silently.