you mean Work VISA?
Term 'Work permit' is used for those who are in Qatar on the different from WORK type of visa (mostly Family visa) and needs a permission to work.
And yes, first you have to find a job...the company (or person) who hired you, will be your sponsor, who will take care of your Work visa and residence permit.
The process is simple. First, application for the Work Visa is submitted. Then it's either granted or refused. Once it's issued, your Residence permit is secured based on this Work Visa.