Install google analytics.
That is simply not possible. It is true that Facebook collects data from its user but it never shared it with the User. In case of any legal disputes or hacking or something like that they can provide data if required by the authorities.
But here I have found several methods claiming to show users who visit your profile and it's totally bullshit.
The common method I have seen is that they told you to check page source and search for ‘InitialChatFriendsList’. Honestly, it will show the friends who you contacted recently and are online and based on the Facebook chat relativity algorithms.
They have no connection with the fact that they visited your profile. Some websites and blogs are misleading the users into thinking that they can find the people who visited their profiles.
And there is another scam that tells you to put some javascript code in your console. This will simply harm your Facebook account. Some are scripts that automatically like some pages, add you and your friends to the group, or allow illegal access to your account.
So I will highly recommend all the users to please not fall into this type of misleading information.