You also had a few syntax errors like missing brackets and misspelled words “resturn” rather than “return” and logical “or” rather than logical “and”
There is also a little issue with the flow of your function if the user didn’t fill in both fields then in your function the first conditional statement would be true and return false and you never get to the third conditional statement where you did your check for both fields, the solution would be to move it to the first conditional statement.
Here is a working version of your code:
if (document.test.firstname.value=="" && document.test.pwd.value=="")
alert ("Both field must be field");
alert ("Both field must be field, please provide your name");
else if (document.test.pwd.value=="")
alert("Both field must be field, please provide your password");
<form name="test" onSubmit="return practice()">
First Name: <input type="text" name="firstname"> <br>
Password: <input type="password" name="pwd" >
<input type="submit" value="Submit"