Auto sorting of mails in Gmail

I want my emails to auto sort themselves upon receipt into different pre-assigned folders.
So, when I open my mail they would be arranged and not cluttering up my inbox. I am seeking step by step instructions.
Would gladly appreciate all the help given
