You can likely straighten a slightly bent crankshaft yourself with a press or sledgehammer if you’re handy. However, for severely bent shafts, it is safest to take it to a professional mechanic who has the proper tools and experience to assess and repair the damage correctly.
Attempting do-it-yourself repairs risks further damaging the engine if not done properly.