Everyone in the United States, regardless of immigration status, has certain rights when interacting with the police and immigration agents. The rights include the right to remain silent, the right NOT to answer questions about immigration status, the right to refuse to sign any papers without first consulting an attorney, and the right to seek help from a lawyer.
EXCEPT: All persons (citizens and noncitizens) have limited rights when crossing the border and can be subject to questioning and searches. See further guidance at https://help.cbp.gov/app/answers/detail/a_id/176/~/cbp-search-authority.
The American Civil Liberties Union (ACLU) has put together an explanation of these rights and others related to what to do if contacted by a police officer or immigration agent. The information published by the ACLU is available in several languages and is available by clicking here.