Pile up roughly equal volumes of dry brown material and wet green material, keep it about as damp as a wrung-out sponge, and turn it when you remember. That is genuinely most of it. Everything below is why that works and what to do when it does not. Below: the practical detail on how to compost, and what most guides leave out.
Composting has a reputation for being finicky. It is not. Organic matter rots whether or not you help it. The whole skill is nudging it to rot faster, and without smelling bad enough to annoy anyone. A pile you neglect completely will still make compost. It will just take a year instead of a season.
The reason beginners struggle is not that the process is complicated. It is that the feedback loop is brutally slow. Get the mix wrong in April and you find out in November. So the advice below is ordered by what actually goes wrong most often, not by what is most interesting to explain.
If you read three of these, read browns and greens, then common mistakes, then how long it takes. Those three between them prevent most of the failures we see people describe.
Carbon and nitrogen. Dry brown things (leaves, cardboard, straw) are carbon. Wet green things (food scraps, grass, coffee grounds) are nitrogen. Microbes need both. Too much green and it goes slimy and smells; too much brown and nothing happens at all.
Water. A wrung-out sponge is the standard description because it is a good one. Squeeze a handful. A drop or two should come out, not a trickle.
Air. The microbes doing the fast, non-smelly work need oxygen. Compaction is what turns a pile anaerobic, which is where the sour smell comes from.
Surface area. Chopped material rots faster than whole material, for the same reason kindling catches before a log.
Working out whether a specific thing can go in the pile? That is the material library. Pile already misbehaving? Start at compost problems and work from the symptom. Deciding between a tumbler, a worm bin and a heap in the corner? Types of composting compares them honestly, including the ones we would not bother with.
Everything on this page and the rest of the basics, in one PDF you can keep by the bin: browns and greens, the moisture test, a quick-reference table of what can go in, and symptom-by-symptom troubleshooting.

Independent sources worth reading alongside this page: EPA, Composting at Home · Cornell Waste Management Institute.