The code itself seems perfectly fine and would do just the job required.
How could I optimize the code below to look better
Since this seems to be more about how your code looks than how it functions, one suggestion would be to remove all of the braces since there is only one statement based of the truth of the condition in the if statements, thus:
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left))
playerSprite.move(-4, 0);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right))
playerSprite.move(4, 0);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up))
playerSprite.move(0, -4);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down))
playerSprite.move(0, 4);
Or, more compact:
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) playerSprite.move(-4, 0);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) playerSprite.move(4, 0);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) playerSprite.move(0, -4);
if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) playerSprite.move(0, 4);