Canon is not strictly defined in The Matrix franchise. All of the films - The Matrix, The Matrix Reloaded, The Matrix Revolutions, and The Matrix Resurrections - form the main core of the series, with additional short animated films (The Animatrix), video games (Enter the Matrix, The Matrix: Path of Neo, and The Matrix Online) and comics (The Matrix Comics) created by the Wachowskis and other artists. Some of these tie directly into the films, while others are more ambiguous.
The Animatrix and Enter the Matrix
The Animatrix (an animated anthology movie) and Enter the Matrix (a video game overlapping with The Matrix Reloaded, with live-action cutscenes) overlap with the main films in the franchise and are considered canon.
Of the eight animated stories in The Animatrix, The Wachowskis personally wrote Final Flight of the Osiris (a direct tie-in to the beginning of The Matrix Reloaded and referenced in that film) and Kid's Story (also referred to in that film, with Clayton Watson reprising his role as Kid, and with Keanu Reeves and Carrie-Anne Moss briefly reprising their roles as Neo and Trinity). The Second Renaissance, the two-part story giving the backstory on the Machine War and creation of the Matrix, is an adaptation of a Matrix comic written by the Wachowskis, Bits and Pieces of Information. Carrie-Anne Moss features prominently as Trinity in A Detective Story. The remaining four stories aren't particularly connected to the films and are stand-alone stories.
The Enter the Matrix tie-in video game happens concurrently with the events of The Matrix Reloaded, and was intended as a cross-platform intersectional media experience, with lengthy live-action cutscenes filmed alongside The Matrix Reloaded but focusing on Niobe and Ghost (with brief live-action appearances from Trinity, etc.). While this game was treated as canon in general, the issue is that it had a branching storyline depending on whether you played as Niobe or Ghost, leaving the question of specifically which of the two branches could be considered the definitive canon one.
The Matrix Comics have a variable canon status. A select few were written by the Wachowskis themselves with some getting adapted into The Animatrix story (i.e. Bits and Pieces of Information). Others are intentionally written in such a way that they could fit within the storyverse of the movies (e.g. The Miller's Tale by Paul Chadwick, a story of early Zion being recounted to a young Morpheus). Others are intentional parodies which were never intended to be canon at all (e.g. Get It? by Peter Bagge, a comedic spoof of viewer post-screening reactions to The Matrix). Others are standalone stories while others fall into more ambiguous situations. And then there are other early comics that differ in continuity from the movies (e.g. Neil Gaiman's Goliath, a Matrix story involving extraterrestrials).
Path of Neo
The Matrix: Path of Neo video game is not considered canon. It follows the plot of the original trilogy (The Matrix, The Matrix Reloaded, and The Matrix Revolutions), with some extra parts set between them, but also adds in some scenes that are only there to benefit gameplay, and training dialog that breaks the fourth wall (e.g. referring to which buttons to press). The "final boss" ending of the game is very different to that of The Matrix Revolutions, which the Wachowskis explain in a short speech before the action takes place.
The Matrix Online
The Matrix Online continues the story after the end of The Matrix Revolutions, with the first chapters written by Paul Chadwick, and continued by the game staff, but with the intention of allowing the players to shape the future of the Matrix. The game contained a number of servers (nine at first, later merged to three), which followed the same plot, but each of which had various unique events. The MMORPG ran for four years, between 2005 and 2009.
The canon status of The Matrix Online was always ambiguous, and after the release of The Matrix Resurrections a major ongoing question has been raised about how canon it should be considered (somewhat comparable to how the earlier Matrix comics differed in continuity to the eventual universe of the films). It is loosely semi-canon, in that some of the events could have happened, essentially telling the story of the first few years after Neo's sacrifice and the beginning of the Truce.
The Matrix Resurrections then fully skips ahead in time to 60 years after the end of The Matrix Reloaded, and thus largely avoids overlapping with The Matrix Online. The main points of difference are the fate of Morpheus, as The Matrix Resurrections changed the circumstances of his death, and the fates of Neo and Trinity, as later chapters (including unreleased chapters) near the end of the MMORPG drastically diverged. The last chapters (that were intended to diverge significantly) were never released but are simply known from outlines that the developers shared after the shutdown. Broadly, the events of the game could have happened but would have gotten progressively more different.