Mikrotik as a firewall

Can I use routerOS as a firewall to block websites and filter traffic

Sure you can.

How can I go about it. Basically, a company wants to restrics ALL websites apart from gmail and thier banking sites. How can I go about it

you can use web proxy