An early 2015 MacBook Pro can be upgraded to Monterey (or earlier). See the following from Identify your MacBook Pro - Apple Support
MacBook Pro (Retina, 13-inch, Early 2015)
Model Identifier: MacBookPro12,1
Part Numbers: MF839xx/A, MF840xx/A, MF841xx/A, MF843xx/A
Newest compatible operating system: macOS Monterey
Be sure to have a current backup (something to have even when not doing an upgrade), then see instructions in: How to download and install macOS - Apple Support
Be aware that if you upgrade to Catalina 10.15 or later you will also need to update any non-Apple 32-bit apps. See: https://www.stclairsoft.com/Go64/
or
https://www.macworld.com/article/232735/how-to-check-if-mac-software-is-32-or-64-bit.html