First you need to request to download your data from Spotify.
Here is a link that will direct you to Spotifys privacy page where you can request to download the data.
Wait until Spotify sends you an email with a download link for your data.
Download your data from the provided link.
Once you have downloaded your data you can start analyzing it.