Most people know that they can save money by carrying out DIY electrical projects instead of hiring electricians. However, the ability to save money shouldn't be your primary consideration. Here are other (equally important) factors you need to evaluate too:
Your Skills and Experience
By and large, your premier consideration should be the level of your skills and experience. Be honest with yourself here, and you are unlikely to go wrong. Sure, there is a first time for everybody, but it pays to start small and build up. For example if you have never even changed a light bulb, there is no use trying to replace a malfunctioning electrical switch.
The Tools and Equipment Needed
Apart from your skills and experience, you also need to know the tools and equipment needed for the project. Some tools and equipment may be needed even for relatively simple repairs. Sure you may be able to pick up some tips from DIY YouTube sites, but you will not be able to complete your project if you don't have the right tools. For example, some of the tools you may need to replace an electrical outlet include needlenose pliers and a circuit tester. If you don't have the tools, consider whether it would be cheaper (both in terms of money and time) to buy them or let an electrician (who already has the tools) handle the job.
You also need to consider the risks and potential complications you may encounter in the course of the project. For example, if your project involves installing an electrical cable in the wall, you will have to drill through the wall. What if you accidentally puncture a plumbing pipe during the process?
Common risks associated with electrical projects include electrical shocks and fire; do you know how to deal with them? Don't forget that professional electricians have insurance coverage to protect them from such risks. For example, they may be able to compensate you (via their insurance) if something goes wrong and they accidentally cause damage, but you may not have the same insurance.
Electricity is a dangerous thing that should only be handled by those who are qualified. Don't let the allure of saving money lead you into dangerous trial-and-error repairs. Even for projects that you may be able to do on your own, it may sometimes be best to hire an electrician. For example, an electrician is more likely to do a neat project (no unnecessary holes or hanging wires) than you are.