I don't know a generic solution, I just can say what I did:
1. I quit my office job.
Worked there for about 7 years. I saved some money and got unemployment benefits (60% of my previous salary) so I had 1 year to do nothing.
2. I did some OSS stuff
OSS teams are almost all remote and they love contributors. So it's not hard to find some and ... well contribute?
It's an easy way to get into a remote team.
I didn't do it for long, because I don't like maintenance dev stuff, which working on Firefox stuff basically is if you a contributor for Mozilla, haha.
3. Do some remote studying
I started a master in computer science at a remote university here in Germany. They had two mandatory programming projects I had to do with a remote team of other students.
We did much coordination via slack, hangouts etc.
This was also a good way to get into the remote workflow.
4. Post your CV online and wait
I saved money for 2 years, so after one year of OSS and remote projects, I posted my CV on some recruiting sites (Angellist, Stackoverflow, etc.) and waited.
Took 3 months till I started my first remote job. Talked to 5-6 companies. Some never called back, some took 2 months to tell me they want/don't want me.
5. Worked remote for 2 years
I worked remote for 2 years in a startup that was about 300km away from me. Went there every 2 months for a day or two. They were rather picky with their remote employees and always tried to persuade me into working in-office. One day they they lost a investor and had to let a few people go, since I was the only remote guy left, I guess they simply wanted to get rid of me, haha. So I got fired.
6. Started freelancing
With >2 years of remote experience and >10 years of general developer experience, I started freelancing.
Got 2 projects. One I found by pure luck online in some project small directory and one in the company where my girlfriend works. Both don't care how and where I work.