In the Library module, click on your RAW image, then under Metadata, choose Save Metadata to File (or just press Command-S [PC: Ctrl-S]). This saves an XMP file (called a “sidecar”), along with your exported original RAW file (as seen in the inset above), and this XMP file contains all the edits you made to this image in Lightroom. If you were to give these two files to someone else and they opened this RAW image in their copy of Lightroom (or in an application that supports XMP data, like Adobe Bridge or Photoshop, for example), that RAW image would reflect the same settings you applied to it in Lightroom. For other applications outside Adobe’s own, they may honor all the changes stored in the XMP sidecar file, or just the basic metadata stuff, like embedded keywords, captions, and copyright data. Again, it just depends on the application. This whole XMP thing is also how you’re able to make edits to your RAW photos in Lightroom on your laptop, and then copy those RAW photos over to your main computer, and it still sees all the edits you made to those RAW images.
Excerpted from Scott Kelby’s How Do I Do That In Lightroom Classic?: The Quickest Ways to Do the Things You Want to Do, Right Now! (2nd Edition)