Steam demos explained: What you can test before buying
A Steam demo is a limited playable version a developer offers separately from a full game. It's useful for testing controls, performance and whether the idea is actually something you want to do. It may not contain the entire opening or use the same settings as the finished release, so use the result as evidence about what you tried, not proof about parts you didn't see.
Start on the game's store page and look for a demo button or link. Some demos have a separate storefront entry. Pick that entry rather than assuming the full game’s main purchase button is a trial. Availability can change, especially around limited events and when a developer replaces a preview. If there’s no install option, check the game's official page rather than relying on an old event announcement.
Go in with a few questions. Do the controls feel comfortable? Is the text readable from your usual seat? Can you get good enough performance with settings you want? If you intend to play with someone else, see which multiplayer modes the demo actually offers. A demo can have a smaller feature set than the game, so it's not proof that every online or accessibility feature will behave the same way.
Don't count on progress carrying over. Valve lets developers arrange save sharing between a demo and a full app, but the developer decides whether that feature is used. Check before investing time in progress you'd be unhappy to lose. The useful result of a demo can just be a better decision about whether to buy the game. It doesn't owe you a head start.
Source: Valve’s official Steamworks documentation on demos.
Updated