After 3 years that drop is pretty aggressive, so before you resign yourself to replacing the battery I'd check two specific things. First, go into power settings and see what processes are eating up your battery (Windows shows it directly in "Settings > System > Battery" or in Task Manager; on Mac it's "System Preferences > Battery"). Sometimes an app got stuck running in the background consuming power without you noticing.
Second, dust buildup in the vents and around the charging port heats up the battery unnecessarily, which degrades it faster. If you're not the type to clean your laptop regularly, that could be the culprit. Run a small vacuum or compressed air along the sides and ventilation areas.
Now, after 3 years the battery's probably also gone through quite a lot of charge cycles anyway. If you check that stuff and it's still a mess, the battery's probably reaching the end of its lifespan, which is normal. It's not uncommon for a laptop battery to degrade by 20-30% after several years of use, but going from 8 hours down to 2 suggests something else is going on there beyond just natural aging.