Reddit has a form where you can request a copy of your data. The process can take up to 30 days, after which you will get a private message on your Reddit account with a download link. The data comes in the form of CSV files that you can open using Microsoft Excel or any text editor.
If you’d rather not wait for Reddit to deliver your data, or would prefer to keep your data in a searchable archive, you can use Brownman’s tool, reddit-user-to-sqlite. This command line application can download the complete public archive of any Reddit user and compile it in an SQLite database file. Just keep in mind that this method will stop working on July 1, 2023, when the API change occurs (because you don't actually own that content you created on Reddit?).
See How to Download Your Reddit Data
Reddit is about to shut off public API access, which means it’s about to get harder to use—and harder to get your data out. Here’s how to grab it now.