Note that unlike previous Just Dance games (and unlike the description on the site) this achievement actually only requires you superstar 40 different songs from the base game. There are 41 songs in the base game (not counting extreme/alternate versions), so you can actually fail to superstar one of the songs in the base game. I personally did all the base songs except "All the good girls go to hell" (when I unlocked the achievement I still had never played this song)
It's also worth noting that songs you superstar in World Dance Floor actually do count. I know this because I megastarred 4 songs in WDF, then megastarred another 36 in regular play and got this achievement as well as the megastar achievement.
In terms of how do you superstar, a superstar is awarded when you score at least 11,000 points on a song. Also doesn't matter if you play with sweat mode on or not (sweat mode doesn't display the score, but you still earn a score as you would in normal play). If you're struggling to get 11,000 on a song that is multiple dancers (ie duo, trio, or quartet) try playing one of the other dancers, as often other dancers might have easier parts (I found this especially true with trio songs, if you pick one of the "backup" dancers they tend to have easier moves)
One thing I'm unsure about is if extreme or alternate versions count towards this achievement. When I unlocked it I still hadn't played any extreme versions of songs so I am unsure if you can avoid other base songs in place of alternate versions.
Also, this does stack with the 3-star and megastar achievements. I unlocked all 3 at the same time after completing a megastar on my 40th song.