I'm personally only familiar with doing this in Beamer, which uses the multimedia package, distributed as part of Beamer itself. (Although it can be used in normal documents as well, independently from the rest of Beamer) The canonical reference on how to use the multimedia package is the Beamer user's guide, section 14.1, but basically it boils down to using the command
\movie[options]{placeholder box}{movie filename}
The placeholder box is some text or other content (could be an image, for example) that determines the size at which the multimedia file is shown.
The multimedia file can be shown either with an external viewer application, which launches when you click on the appropriate part of the PDF file, or directly in the PDF viewer itself. In both cases, though, this functionality is only supported by certain PDF viewers, mostly Adobe Reader. The file types it is able to display depend on the capabilities of the PDF viewer, or if using an external viewer, on which viewer program is being used.
A quick search on CTAN turns up a possible alternative, media9 (which supersedes the old movie15 package). According to the documentation, its main command is
\includemedia[options]{alt content}{media file}
and it seems to offer some of the same main features as Beamer's multimedia. However, I've never used this one myself so I can't say anything about it that isn't mentioned in the package documentation.
movie15package, although it does seem to require Acrobat Reader to play the movies. Maybe some other viewers will work, but you definitely can't count on it in general. A nice feature is the ability to define a 'poster' image that takes the place of the movie when the movie is inactive. This way you can still have something meaningful on the slide if it turns out your viewer can't play the movie. – Michael Underwood Aug 12 '10 at 01:10multimediais not automatically loaded bybeamer, its distribution means notwithstanding. – Mar 12 '14 at 18:37multimediaOkular plays the embedded .mp4 where acroread complains that it cannot find the movie file and asks whether I want to pick a replacement. – jshlke Jan 05 '15 at 09:40movie9documentation mentions including the video file, so you can give that a try. If it doesn't work, I suggest asking a followup question. – David Z Aug 21 '16 at 16:37\movieexample, above. – CPBL Mar 19 '19 at 20:27\movieto include eithermp4ormpg:(, using eitherpdflatexorlualatex. – gerrit May 27 '22 at 09:16