I am assuming you mean it sometimes get to post boot.
The advice about beep codes you have received here is spot on, but any advice that points to particular components is pure conjecture & extremely misleading. At this stage & with the information you have given any one or more of the components could be at fault including the power supply or something as simple as the (S.P.C connections) system panel connections, (power reset, hard drive led pin connections, yep even they could be screwing up a boot) it could even be a HD cable the wrong way.
However the fact it sometimes boots may mean you’re in luck.
This might seem a little long-winded but I assume you’ve been messing around with your machine for a while & this is what you will pay for if you take it in for repair.
There are logical routines when diagnosing on the workbench & they will save you guessing or running round in circles.
Because you sometimes get a successful boot there are a few things you need to do before you can rely on the beep codes.
The first steps you need to take is to unplug everything including memory, power, system panel connectors, then reinstate all required connections leave hard drive & cd roms unconnected. Using your mobo manual & paying particular care to get the (S.P.C) connections in phase, check any jumpers are set right & clear all bios settings with the appropriate jumper.
Pay special attention to seating AGP graphics cards if you have one, they notoriously give a loose fit when the socket connectors are mounted on thin circuit board. (Often the cause of intermittent boot failure). Double-check your connections & jumper settings & your ready to go.
OK you’ve got the bare bones build & set-up checked, the bios set back to default, you will either be able to boot or you can start to test knowing it’s not a build problem.
I won’t go in to detail about testing you can find 100`s of decent guides if you Google `PC won’t boot` one you can try for a start is,
www.ocforums.com/showthread.php?t=266936
But to be honest apart from using the beep codes as a guide & substituting suspect parts there’s not a lot more to it.
So good luck and remember Before you open your computer up make sure you earth your self to get rid of any static, static kills computer components instantly or by a process not unlike slow poisoning. ! If you don’t have a wrist strap, you can easily earth your self by leaving your machine plugged into the mains & switching the socket off. All you do then is touch one of the screws of the power supply if you move away for any reason earth your self again.