From what I know, it never hurts to reach out to companies you're interested in interning at, either directly or through contacts (although you're likely to have the best chances with the latter.) Companies will virtually never reach out to you first.
You can also check job boards for internships. If you're a student or alumni of a college or university, their career services department would be able to point you in the right direction.
However, whatever you do, you should make sure the internship you take is legitimate:
According to US Labor Law, internships should almost always be paid at least minimum wage. (The same is true in other countries.) There are very specific regulations for unpaid internships, so you should look up your country's laws regarding this. (P.S. Ours can legally be unpaid because our company has no income yet, and even I'm not getting paid; we're just building FOSS.)
Whether paid or unpaid, an internship should never cost you money, either up front or "if you don't finish." There are a number of (legal) scams that claim to offer internships, but require you to pay them back if you don't fit some criteria. These are never okay.
Any internship should have you working on a real project alongside actual developers! There should also be training involved. An internship should be the same as a junior development position, but with more on-the-job training.
...it should not involve you fetching coffee, sweeping floors, or doing any other menial jobs shuffled off on you by more senior devs. Contrary to popular belief, interns are NOT gofers. Any internship that treats you like one should be shunned.
In short, programming internships are real development jobs, and should be treated as such, both by you and your employer. You should ask questions about internship you're thinking about applying for. Find out what you'll be working on, who you'll be working with, what the training is like, who you'll report to, what the expectations are, and yes, if it's paid (and how much) or unpaid.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.