Many forms ask for a Social Security number. If you are not allowed to work, you cannot get one. Some offices, most often the DMV (driver's license office), then ask for proof that SSA said no. Social Security gives a letter saying you are not eligible for a number. People call it the "SSN denial letter" or "letter of ineligibility".
Who often needs it: F-2 and H-4 spouses without a work permit, F-1 students without a job, and some visitors who want a state ID.
This differs by state: some DMVs want the letter, some accept a signed statement, and some only check online. See In your state below.
Wait until your I-94 shows online and, for students, until your school checked you in.
Start the Social Security number request online at ssa.gov. When the system finds you are not eligible, it tells you to visit an office.
Visit the Social Security office or Card Center with originals: passport, I-94, and your status papers (I-20 or DS-2019, your spouse's approval notice for H-4, marriage certificate).
Say clearly: "I am not authorized to work. I need a letter for the DMV saying I am not eligible for a Social Security number."
The officer can print the letter there, or it is mailed.
Check the name and the date on the letter. Some DMVs want a recent one, so get it close to your DMV visit.
It is not a bad mark on your record. It only says you did not have the papers for a number on that day.
It does not stop you from getting an SSN later, for example after you get an EAD.
It is not an ITIN. For taxes you may still need an ITIN. See How to get an ITIN without an SSN (Form W-7).
J-1 scholars asking for the letter. J-1 exchange visitors can get a real SSN.
Going before your I-94 or SEVIS record is active. The office cannot check you.
Losing the letter. Keep it with your originals.