I have 500 MB of unnalocated space on my SSD and I want to add it to the primary partition but I cannot because there is a EFI partition between the unnalocated space and the primary partition.
Don't. 500MB changes nothing (0.4% of total disk capacity).
To do this, you'd have to move EFI System partition to start of the drive, then C: partition right after EFI System.
Only after this, C: can be extended (if free space is after it, not before it).
Boot configuration data will require fixing.
If power fails during move of C: , your data is corrupted and you'll have to reinstall.
Also these operations require 3rd party partitioning management software. Built in windows tools do not allow this.