If you want to write a chess game into a file so that an engine, or a chess database program, ... can read it and work with it, then you write it into a so-called pgn file.
(A pgn can also contain just part of a chess game, with a starting position and some of the following moves.)
For example, you can write there the players' names, the date and year when the game was played, the moves of the game in chess notation, the result, ... just all of the info that is most useful about a chess game. In a pgn file, all this info is contained in a format that will be readable by the most of the common computer programs used for chess.
And yes, if you have a game in pgn format on your computer, and if you wish to share it for example in a diagram in a chess.com forum comment, you can just copypaste the pgn file's content into that diagram when making the diagram. (You can also choose to enter the moves graphically in that diagram, the pgn will be automatically generated from that info then.)
Please excuse the silliness of this question, but what does one do with a .pgn file? Is that just the format that particular chess engines use to analyze games?
The only chess engine, if I am correct in calling it that, that I use at the moment is the one on this site. Should I be looking into another if I want to study/train more efficiently.
Or are there other advantages of .pgn files of which I am unaware?
Oh, wait . . . pardon me for thinking alound (this is kind of one of my problems as a chess player, not planning what I am going to do well enough), but are .pgn files how people include their games in these forums for analysis?
What else am I missing.
Thanks so much for anyone who has been patient enough to read this, and is willing to answer such a newbie question.