A useful slug tells readers what the page is about without copying every word of the headline. Keep its distinguishing nouns, use hyphens, and remove filler only when the meaning stays intact.
For example, “A Beginner's Guide to Compressing PDF Files Without Losing Readability” could become pdf-compression-readability-guide. Before publishing, check whether the slug already exists and whether it still makes sense if the headline changes later. Avoid dates unless the date is part of the subject.
A slug generator can provide a draft. Review accented characters, non-Latin text, and punctuation yourself; automatic normalization can change names or produce collisions.