to begin if you have a threaded fork, which i take it you do, it is easiest to replace with another threaded fork. i assume you want to change from an aluminum to carbon? yes, there are different lengths of steer tubes (the part with the threads on it) you need to buy one that fits your frame. i suggest measuring the one that you have and getting the closest one to it. a little longer (1-2cm) is okay because you can make up that with spacers. then it is simply a matter of knocking off the crown race and swapping everything.
now to change from threaded to threadless becomes harder. the old threaded ones were 1" and you will need to stick with a threadless fork that is 1" diameter. you will need to get a threadless headset, spacer kit, a saw guide or tubing cutter, a new threadless stem and handle bar (they are bigger around, chances are your old wont work), and no you can't really mix the two technologies very well.
then you will need to know where you want your stem and bars to be, and add spacers to place it where you want it. i would error on the side of too high, because you can always cut more off later, and you can't add it back on if you position the bars too low. you use a saw guide and a hack saw or tubing cutter to make a good square cut. then you simply install the headset races, bearings, spacers and stem. mistakes can be very costly. i suggest if you arent sure about it, have a pro or someone that knows do it. you are better off paying someone than having to throw away a very expensive upgrade.