In Emulationstation/RetroPie go to: Retropie (i.e. the setup menu) –> Configure WiWi –> choose ‘Connect to WiFi network’
You’ve probably done that already and apparently it won’t work. Unfortunately for you is that this dialog screen already does “every Linux trick” in the book to connect.
Since successfully connecting to your beloved Pi the first time: did you change something w/ regard to hardware? Like connecting other USB devices? An USB hub? In my experience WiFi can eat a lot of power and due to extra hardware your Pi might be under powered now.
P.S. The way I force my Pi to connect to WiFi is:
sudo ifconfig wlan0 up
And then wait a minute.
Check IP address and if your connection is up w/:
Good luck! 🙂
P.S. Thanks to Buzz I corrected the typo in wlan0.