^^this
As said, good quality and heavy BBs are the key.
But first: clean the gun properly. If you can't take the barrel out, then use the cleaning rod with a slice of a paper towel with rubbing alcohol (isopropyl) to clean everything, including the hopup rubber. Do this a few times until it comes clean out. Then use dry paper towel and then do a few shots to clean the rest. If you can take the barrel out (and put it back properly) then use warm soapy water to clean the rubber and the barrel, then warm water. This usually improves accuracy significantly.
In a normal AEG I use 0.28 or 0.30g BBs. Way more accurate than light ammo and fly further and gets there faster.
I just moved to a house where I have a 45m range and I tested my 340 fps sniper rifle. With 0.28 it shoots the 45m in a high arc trajectory but with 0.36 it's almost a straight line. So imagine what happens on let's say 55m with this setting. The 0.28 will hit the ground but the 0.36 will still be flying. They both can reach longer distance but with lighter ammo I would have to aim way above the target.
Anyway. Clean the gun, use good quality and heavy BBs. Make sure your gun shoots 320+ fps and with some consistency (+-5fps is okay). Put some time into setting the hopup and the sights. First set the hopup, then the sigths to about 30-40m.
Then learn to shoot. This takes some time, but this improves the accuracy a lot. First learn to shoot a target at 30-40m from standing and on one knee because these will be the most used positions. Then stand sideways, turn toward the target and shoot. Then start standing with your back to the target. Then learn shooting from cover. Then learn shooting on the move.
While doing this use single shots and make sure the first shot hits. (There are a lot more to practice, this is just for improving accuracy.)
Only after these should you consider upgrading the gun IMO.