Rotate the character movement with the character

Hello I’m new to Unity and everything around it and I don’t get it. I took a script for looking around using the mouse and I also made a script to walk in every direction. The problem is when I walk forward I use W but when I turn around by 180° and I press W the character walks backward. How can I fix this problem?
Also how can I hide the mouse while playing?
Thx for every answer

Are you talking about First Person Movement or Third Person Movement? Instead of making your own from scratch, try seeing this for First Person Movement and this for Third Person Movement. It’s much easier to follow along than to make your own.