You most definitely need at least 8 gigs of RAM on a gaming computer; ideally you should have 16 gigs, and more than 16 will be overkill and a waste of money.
It is also highly recommended to use an SSD for your operating system and HDD for general storage, including games. Many modern games come with Denuvo DRM, which, in short, kills your HDD if the game is on it. Having your OS on a HDD that is getting murdered constantly is dangerous. If the game is on an SSD, there will be no harm done to it, due to the nature of SSDs.
GTX 1050 Ti is kinda outdated. It can run indie games like DoS2, but mainstream AAA titles like Ghost Recon: Breakpoint will run at medium settings with 25-40 fps in 1080p (personal experience). I suggest swapping it for a Radeon graphics card since they offer literally the same level of performance as Nvidia but much cheaper. I bought Radeon Rx550 and sold the old 1050ti.
Honestly no idea about whether you should upgrade your CPU. I have almost the same CPU and I have never encountered any cases where it caused bottlenecking due to its poor perfomance. I would say your CPU is fine.