You need a set of observations of the sky coordinates and the time of observation of the comet. Preferably, you want these observations as far apart as possible so that you can properly solve the equations for the orbit elements of the comet. The process is actually rather tedious, and many books on observational astronomy show you how to do it. Basically, you need to translate from the Earth-centered Right Ascension and Declination coordinate system to a heliocentric one, and then solve a set of equations to fit a conic section ( ellipse, parabola, hyperbola) through the measured points you sighted. It is tedious and requires some iteration. There are no doubt canned programs in shareware-land that do this for you.