If you’re locked out of your home then there are lots of things you can do to solve the problem.
You can ask a friend for help who has a spare set of your keys, stay the night somewhere else, or break down the door. Any of these options will save you time and will save you money in the short term, however they all fall shot of calling a locksmith in terms of the most expedient and prudent solution to these scenarios, and there are many reasons to opt for calling a locksmith over breaking and entering or getting help.
One reason is that if you break into your own home or even if you attempt to pick the lock then you risk (or guarantee in the former instance) causing damage to your property. This then can be dangerous and will cost you money to repair ironically more money than if you’d just called out a locksmith.
At the same time, calling a locksmith will mean that you can get insight into the nature of the problem and have it solved.