The Freedom of Information Act (FOIA) allows people to request federal agency records, including records by the agencies involved in immigration to the United States: Customs and Border Patrol (CBP), United States Citizenship and Immigration Services (USCIS), Immigration and Customs Enforcement (ICE), and the Department of State. There are some limitations to what federal agencies can and will disclose, as provided by three exemptions under law enforcement record exclusions, and nine exemptions under the law.
Anyone can submit a FOIA request. You might want to submit one if you're an immigrant and want to access records that you no longer have yourself. You might also want to submit a FOIA request if you are undocumented or overstayed your visa and were picked up by ICE and now are planning on applying for a visa or adjustment of status.
If you have additional questions about FOIA requests and immigration, you should contact an immigration attorney.