You cannot get a security clearance without a need to have one. So basically, if you don't have it and the job you seek requires an active clearance as a prerequisite, you're screwed. If the company will allow you to work for them pending clearance, then you're OK.
The best way is to work for a company that has a number of positions requiring clearance, make yourself useful to one of those groups, and work into a role that requires a clearance. Then your clearance can be applied to any job, as long as it remains active.