You need to correct the following things:
single = means indicates assignment, not comparison.
I assume you would like to check whether the string entered is equal to "happy" and "sad". Use equals method rather than "==" for checking string values.
why you put if (sc = sad) inside if (sc = happy). the inside check will never executed.
You need to check the values entered from console, rather than using Scanner sc itself.
So I think you need to change the code like follows:
String mood = sc.nextLine();
if (mood.equals("happy")) {
System.out.println("test");
}
if (mood.equals("sad")) {
System.out.println("I am sad");
}