How do I find by name the doctors who are considered the best in their field in america? Looking for ophthalmology and obgyn.

Not easy. There is not an independently validated listing. You should seek a board certified person. Ask about which medical school and post medical school training they have had. Are they affiliated with a reputable local hospital? Magazine listiings (the top 100 docs in metro city) are unreliable and subject to manipulation. Better docs often get sued more, as they handle tough cases. So not easy.
Best docs. Periodically, time mag et al publish article listing "best doctors" by specialty as well as "best hospitals". Researching major medical centers may also elicit whom they consider outstanding in their field. State medical societies may provide similar info.
Best ophthalmologist. The best way to look for esteemed ophthalmologists is to look at the American Academy of Ophthalmology website. You can go to the tab "Find an Eye MD" and locate by region and sub specialty the names of ophthalmologists. All Eye MDs here are board certified, meaning they have taken both oral and written examinations, in addition to other activities to stay up to date with new advancements.
Research. There is not an independently validated listing. You should seek a board certified person. Ask about which medical school and post medical school training they have had. Are they affiliated with a reputable local hospital? Magazine listiings (the top 100 docs in metro city) are unreliable and subject to manipulation. Better docs often get sued more, as they handle tough cases. So not easy.
It all depends. When someone is "best in field" it's usually for a specific procedure or niche. If you have an extremely challenging case of academic interest, you'll eventually end up there by referral. Realistically, the best doc for most people is someone who is safe, nearby for good follow-up and works in a good facility. Remember also the biggest names usually work with students and residents, if it matters.
Google & Referrals. There is a list that can probably be found with google. It is also good to ask other doctors who they consider to be thought leaders.