Added 2 extra stitches

hello i am very new to the knitting scene i just took my first lesson sat had a class i went too and my instructor told me to keep track of my stitches my scarf calls for 40 stitches but somehow i have added 2 extra stitches and i now have 42 instead of 40 how do i fix this also my teacher hasnt shown me how to cast on or anything she just wanted me to start knitting so she started it and i took over please help

That’s very, very common among new knitters. Usually it’s because you did a YO (yarn over) which is an increase or eyelet or you knit into a part of the knitting that isn’t really a stitch on the needle. At the top of the page is a post called “mysterious extra stitches” that addresses this.

Since you are just learning you could just knit two stitches together (k2tog is a real decrease) twice to correct this. OR you can start over or rip back to before where you added the stitches. I’m not sure what your teacher wants you to do. She may just want you to leave it and then you can show her and she can tell you what she suggests.