<div id="forms">
<input type="text" name="name" placeholder="Your name" id="yourname">
<input type="text" name="mail" placeholder="Your Email" id="youremail">
<div>
<input type="text" name="subject" placeholder="Subject" id="subject">
</div>
<textarea id="textarea"> </textarea>
<p id="button4">Send me a message</p>
</div>
JQuery
$("#button4").click(function() {
let yourname = $("#yourname").val()
let youremail = $("#youremail").val()
let subject = $("#subject").val()
let textarea = $("#textarea").val()
if (yourname=='' && youremail=='' && subject=='' && textarea=='') {
$("#result").html("All fields are required")
}
});