Cell phone batteries do tend to lose the ability to hold a charge over time so it's not at all unusual that yours no longer lasts as long as it used to after three years of use. The fix is, of course, to replace the battery. On your phone it's relatively simple to do; an opening pick and a screwdriver appear to be all you really need. Here's a video showing the procedure; I might add that heating the rear cover with a hair dryer will help soften the adhesive and make it easier to remove.
[link|https://www.youtube.com/watch?v=HD56QeRLSWY|realme 7i battery problem / realme 7i battery change / blp803 battery replacement - YouTube|new_window=true]
In addition to ordering a new battery, you'll want to pick up a precut adhesive sheet to replace the glue holding the rear panel on; that will help seal it against dust and water once you're finished. You can find batteries many different places; I usually start with Amazon, eBay and AliExpress and anything else that comes up on a search. Here's one of the first ones that came up on my cursory search.
[link|https://www.aliexpress.us/item/3256803627838649.html|New BLP803 5000mAh Battery for OPPO ReAlme C17 / Realme V3 / Realme Q3i / Realme 7i Smart Phone High Quality Batteries - AliExpress|new_window=true]
Good luck with your repair; be sure to take lots of pictures and use those to create your own iFixit guide for those who come after you. The community will be grateful and you'll have fun!
[link|https://www.ifixit.com/Guide/new|Create a new Guide - iFixit|new_window=true]