Just a heads up that sometimes it's not possible to know, but some factors can narrow things down. Details of your situation will help.
That depends on many things, the herpes type, 1 or 2, its location, who around you has the virus and if sexually transmitted, what episodes lead up to possible infection. Please give details such as these if you'd like to work through the issue.
The most clear cut way is having previously had a negative blood test for HSV and then having a subsequent positive swab or blood test will in most cases narrow things a bit.