So what is your question: How to avoid inserting duplicates, how to remove duplicates in the table already, or both?
Looks like whatever feeds @UserID is doing it twice, hence the duplicates when it hits your query.

if not exists (select * from LOGINDETAILS where userID = @UserID and TodaysDate =FORMAT(GetDate(),'MMddyyyy') and DATEDIFF(SECOND, StdTimeIn,GetDate()) < 60 and StdTimeIn IS NOT NULL and StdTimeout IS NULL)begin INSERT INTO dbo.LOGINDETAILS ( UserID, StdTimeIn, TodaysDate ) SELECT @UserID, CURRENT_TIMESTAMP, FORMAT(GetDate(),'MMddyyyy') WHERE NOT EXISTS (SELECT * FROM dbo.LOGINDETAILS WHERE UserID=@UserID and StdTimeIn=CURRENT_TIMESTAMP and TodaysDate=FORMAT(GetDate(),'MMddyyyy'))end

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

It would be possible only if the SELECT part returns 2 duplicate rows that don't yet exist in the target table but in this case that is out of the question because you don't SELECT from a table or sub query but you simply return a rowset with one row formed by the variable content and current date values.

Are you sure you used the code I posted? Or is there a trigger that in the background duplicates the insert somehow?

Still, if you really want to be helped then you need to backup your statements with some data. I would like to see an example of data before and after you used my code in order to find what causes the duplicates, if that really is the case. The only reason I would see is that the values in the table somewhat differ from the ones are inserted at the moment when they are compared in the WHERE clause. This starts to sounds like twilight zone.

Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.