1 Know what you are looking for: shape and color
Every LEGO® piece has a part number that names its shape — the “Tile 1 x 3” is 63864 — and a color. The same shape exists in many colors: to find a piece again, or to order it, you need both.
2 Read the number molded on the piece
Some pieces carry a tiny number molded into the plastic: it is the part number of their shape. It does not give the color, it can be hard to read, and many pieces have none you can make out.
If you still have the building instructions, the parts list printed in many of them shows each piece with its own number, which covers the shape and the color together.
3 Search by shape
Without a readable number, describe the piece. Online parts catalogs, such as Rebrickable's, sort pieces by category — bricks, tiles, slopes, wedges — and by size, counted in studs: a 2 x 4 brick is two studs by four. Narrow down, then compare the pictures with the piece in your hand.
4 Take a photo
A photo works when the number is unreadable or absent. A recognition service compares the picture with images of known pieces and returns the most likely part number, with a confidence score.
BrickBack works this way: it sends the photo to Brickognize, an online recognition service, which returns the piece's part number, name and color. Nothing is recognized on the phone itself: scanning needs a connection, the app asks for your agreement before the first photo, and it identifies one piece per photo. Brickognize can also be used directly on its own website.
Recognition is not certain. Check the result against the piece, especially between close colors, and scan again from another angle if it does not match.
5 Then put the piece back where it belongs
A part number on its own does not finish anything. In BrickBack, a scanned piece shows which of the sets you track are missing it: you choose where it goes, that set's count goes down and its progress fills up. Scanning is free and unlimited, and the catalog covers over 28,000 LEGO® sets.