Cookies are small text files a site saves on the device of whoever visits it and sends back to the server with every request. Local storage and session storage do something similar but not identical: they stay in the browser and never travel to the server.
The distinction matters, because it changes how long things last and where the data ends up. The law treats the two tools alike when they are used to track people: here they are not, and the full list is below.