With every phone coming out every year the older phones gets often slow and laggy and do not get updates after a couple of years. Due to the open source nature of the android os third party developers can create custom roms and tweaks that can enhance your device's performance.
Firstly to increase the performance there are a couple of apps that tweaks the system to make it snappy. But the best one is in my opinion Seeder.It is a 1$ app which can be downloaded from the playstore, but it can also be downloaded from XDA website. But it requires Root and it installs just like a normal apk and easy to operate.
Second option is to install a custom rom which is a bit tricky and hard. First of all you need to root your device. There is a different way to root every other phone so better use GOOGLE. Than install custom recovery which is also different for every other phone. GOOGLE!. Last step is to choose a suitable custom recovery for your device. There are many custom recoveries for different purposes. Some enhance performance, some improve battery life, etc.
So if you want a more detailed Post about rooting and stuff let me know in the comments.
And before leaving please leave an upvote and follow.