At least on the PC version, you can mark an item as a Favorite or as Trash by moving your mouse to the right side of the item where a star or X will appear. (The hidden hover areas appear vertically above each other.) Clicking on these will mark them as either a favorite or as trash respectively.
A favorite item
cannot can still be sold but has a nice marker on it so it stands out better. Trash items can be sold in bulk at stores (by going to the Buy menu and pressing Delete on PC, clicking Left Stick on the console), so you can get rid of your trash items easily at the store.
The console versions or using a gamepad will have dedicated buttons to toggle these settings.
Using a gamepad or playing the Xbox 360 version, you can toggle these settings pressing the Left Stick.
I imagine the PS3 version will use L3 to toggle the settings.