How much should it cost to replace ignition?

I own a honda prelude 1999, when i go to start it the dash lights turn on and the radio and i can turn the key which starts it but when i turn the key back to the position it would drive in the car shuts off. Also sometimes when i'm driving it stalls when it shouldn't. Do i need a new ignition or is it something else and if so how much would it cost in a mechanic shop to be fixed? And how much would it cost to just buy an ignition and do it myself?

Before you replace the ignition switch, have a mechanic check the ignition oscillation adjustment relay control module, it could just be out of adjustment.