Why it matters when you are writing
A DOI has two parts separated by a slash: a prefix beginning “10.” that identifies the registrant, and a suffix the publisher chooses. On its own it is just a string; it becomes clickable when you put it behind a resolver, which is why current APA and MLA practice is to print it as a full https://doi.org/ link rather than as a bare number or the older “doi:” form.
Finding one is usually a matter of looking in the right place. It appears on the article’s landing page, on the first page of the PDF, in the export record from a database, and in the CrossRef search index. If a search returns nothing, the work may genuinely have no DOI — book chapters from smaller presses, conference posters, gray literature, and older articles often do not — and in that case you fall back to a stable URL or, for print, to no locator at all.
One habit saves a lot of trouble: capture the DOI at the moment you first save a source, not when you assemble the reference list. Reconstructing forty DOIs from a folder of PDFs named “Okonkwo_final_2.pdf” is an afternoon you will not get back, and it is exactly the point at which entries get quietly dropped.