The procedural style of mysqli_prepare
expects the first parameter to be the connection variable and second one to be the string (query).
Change
mysqli_prepare("select user_id from users where user_name= ? and password= ? ");
to
mysqli_prepare($conn, "select user_id from users where user_name= ? and password= ? ");
Read documentation here.