At the table
Trattoria, osteria, ristorante
The word on the sign tells you the price, the pace and how to dress. Usually.
The words are not interchangeable, and they are also not regulated. Nothing stops a restaurant calling itself whatever it likes. But the words still carry meaning, and the meaning is a reasonable prediction most of the time.
Osteria
Historically a place that sold wine and put out food so people would stay longer. Now: simple, cheap, short menu, often no written menu at all, frequently the best value in a given street.
Expect a handful of dishes, paper on the table, and a house wine sold by the quarter, half or litre. Expect to sit near strangers.
The word has also been reclaimed upwards. An "osteria" in an expensive part of a city may be an expensive restaurant using the word for its warmth. The clue is the menu in the window.
Trattoria
The middle, and the one most visitors are looking for without knowing the word. Family-run, a proper kitchen, a menu that changes with what is available, wine that is not an event.
A trattoria is where you find the regional cooking done without ceremony. It is also where the daily specials matter most, because a trattoria buys what is good that morning rather than working from a fixed list.
Ristorante
The most formal of the three. Printed menu, table linen, a wine list rather than a carafe, more staff, higher prices. Often excellent, occasionally simply more expensive.
You would book. You might dress. The pace is slower and the meal is the evening rather than a part of it.
The others you will see
Enoteca. A wine shop that serves food, sometimes very good food, usually small plates built around what you are drinking.
Tavola calda. Hot food over a counter, chosen by pointing. Lunch, fast, inexpensive, and often much better than it looks.
Pizzeria. Pizza, and normally only in the evening, because a wood oven takes hours to come up to temperature and is not worth firing twice.
Braceria. Grilled meat, ordered by weight.
Reading a place from outside
The menu in six languages with photographs is the clearest single signal, and it usually means the room is priced for people who will not come back.
Handwritten specials, a menu that fits on one page, and a room with Italians in it at Italian hours are the opposite signal. Italian hours means lunch from around one and dinner from around eight, later the further south you go. A dining room that is full at half past six is full of visitors.