If you can get to the United States, whether by coming to the border or by traveling on a nonimmigrant visa or under the Visa Waiver Program, you can in theory apply for asylum upon your arrival. You would tell the Customs and Border Protection (CBP) inspections officer that you fear returning to your country and wish to apply for asylum. However, various barriers have been erected in recent years, as described below. Now might not be the time to try this strategy.
As a way of blocking entry to asylum seekers, the Trump administration immediately expelled most migrants attempting to enter at the U.S.-Mexico border, including asylum seekers. This was based on supposed public health grounds and COVID-19 concerns, under Title 42 of the U.S. Code (despite public health officials finding that there's little evidence this will help).
The Biden Administration has held to this practice, though it makes exceptions for unaccompanied children. They are instead taken into the temporary care of the U.S. Department of Health and Human Services (DHHS), which tries to place them with sponsors, such as relatives already living in the United States.
(At least the Biden Administration put a stop to the Trump Administration's so-called "Migrant Protection Protocols" or MPP, more commonly known as the "Remain in Mexico" program. Under this program, asylum seekers were not allowed into the U.S. to have their claims for asylum heard. Instead, they were sent to Mexico to await the outcome of their cases. This meant waiting in difficult and often dangerous conditions, or crowded camps, where it was hard to even stay in communication regarding one's upcoming hearings or other processing. It took litigation all the way to the Supreme Court before this policy was ended, in June 2022.)
If you have some other way to enter the U.S., such as on a B-2 tourist visa, you can apply for asylum by mailing in an application, with supporting documentation, on Form I-589. The form and instructions are available for free download on the USCIS website. However, if at all possible, you should get help from an attorney.
Even without hurdles such as Title 42 expulsions, there are many reasons to avoid requesting asylum at the port of entry to the United States.
One is that CBP inspections officers have the power to quickly find someone inadmissible and deport them, in which case the deportee will not be allowed to return to the United States for five years. This can happen if an inspector believes that someone is making a misrepresentation (committing fraud), or misrepresented the truth when getting a U.S. visa, or does not have proper entry documents. This quick deportation procedure is known as "summary exclusion." It can be applied to anyone except people entering the United States under the Visa Waiver Program (according to a 1999 decision by the Board of Immigration Appeals).
Nevertheless, there is an exception to the summary exclusion process for people who fear persecution and request asylum. So, even if you do not have the proper documents or you have made a misrepresentation, you could still be allowed to apply for asylum if you can show that you'd be likely to win. But making this clear is a challenge.
After you have said you want to apply for asylum, you're supposed to be given a "credible fear" interview by an asylum officer. The purpose of this interview is to make sure you have a significant possibility of winning your case. Most importantly, the officer will want to be sure that your request is based on a fear of persecution. This interview is supposed to be scheduled quickly, within one or two days, but it has been taking much longer.
If the officer isn't convinced of your fear, you will need to request a hearing before an immigration judge. If you don't, you will be deported from the U.S. and not be allowed to return for five years. The judge is supposed to hold the hearing within seven days, either in person or by telephone.
If the judge finds that you have a credible fear of persecution, you'll be scheduled for a full hearing. In that case, you should seek an attorney.