To pull up a Spotify Code, you just toggle the Share function with a tap on the three dots to the right of your screen when playing a song. Hit Share and you'll see the code (which looks like an audio waveform) just under the album image at the top of your screen. To grab the track, your friend just needs to tap the camera icon to the right of the Search bar in their Spotify app and aim their phone at your screen. The captured song will start playing right away.
Snapchat, of course, has a similar system that lets potential chatters grab each other's contact details with a simple photo of their Snapcode, which looks more like an old-school QR code than the Spotify one does. You don't have to wait to use the new Spotify codes, though. Heck, anything that makes sharing obscure indie songs and deep house tracks simpler is sure to get some use.
Update (5/8/17): Even though Codes popped up in the Spotify app on Friday, the streaming service waited until today to make the official announcement. There's not a ton of new information in the post, but there are a couple of notable items. First, the codes link to any artist, song, album or playlist that's available on Spotify -- even your summer road trip compilation. Second, you can save the code images to your phone's Camera Roll so you can beam them out via your go-to social channels. Again, Spotify Codes are available inside the Android and iOS apps.