How do I talk to her?

I really like this girl from my class but the problem is she isn’t into me(I know for a fact). I had like this phase were I would talk to her everyday for like 3months without hesitation and then suddenly I lost all my confidence and now I’m scared to even approach her. Help.