Amtrak roomettes are private (and small) sleeping accommodations on long-distance trains. There are sliding doors that you can close at any time, or leave the door open for easy access to the hallway. You can lock the door when you are inside the roomette, but you cannot lock it from the outside, so avoid leaving valuables in the roomette when you are not there.
Bedrooms offer larger private accommodations at an extra cost. The only non-private seating on Amtrak trains is coach seating.