Ideally you should have at least 8GB of RAM and a SSD hard drive on your laptop. VSCode (and I think most, if not all, IDEs) and the Android Emulator consume a decent amount RAM separately, let alone concurrently.
I think Windows 7 should be fine.
Upgrading your hardware isn't always ideal (or cost effective) so in order to work with what you have, I have two suggestions.
First, check for any updates, either for VSCode, emulator, Flutter, Android Studio etc. Make sure all elements of software are updated to a stable version. Also check to make sure there aren't version conflicts between them.
Second, try using an Android device rather than the emulator. This way your RAM can allocate more power for VSCode rather than be further burned with the emulator.
Third, if you don't have access to an Android device, you can try to configure your emulator acceleration. Try experimenting with the different modes and see if a higher accelerator is better or a lower one, although I'm assuming if you try to use a higher one you'll run into issues as it might consume more RAM.
This question is a bit dated but it could still provide some insight. You could also experiment with other Android Emulators to see if one works faster and consumes less RAM.
This is a bit of a stretch but I think you could also try to change the device on the emulator being used. Maybe an older device with an older Android version might not consume as much RAM or require as much processing power. I'm merely speculating here but I figured it's worth a shot.
Personally, I have not tried any other emulators and pretty much always use an Android Device instead of the emulator. I think you're best bet, aside from upgrading your hardware, would be to get your hands on an android device. If you can't, then try the other options I mentioned (accelerator configuration, different device/OS version for emulator, other emulators etc.).