Federal law does not require you to have an attorney unless you are a corporation. You are allowed to file Pro Se, that is, on your own without an attorney.
However, without the assistance of an attorney, it is extremely difficult to file a bankruptcy and do so successfully. Success being you get a discharge and the debt relief you sought.
There are many deadlines and documents which must be produced and filed with the court.
Schedules listing all of your real and personal property and exempting as much of your property that the law allows must be filed. Non-exempt property may be sold to pay creditors depending on the chapter of bankruptcy you file. Creditors must be properly noticed and negotiated with depending on which chapter of bankruptcy you file.
Strict deadlines must be followed or your case could be dismissed. If your case is dismissed your bankruptcy filing will still appear on your credit report and you will not achieve the debt relief you sought.
If you have a bad tooth, I would not recommend you pull it yourself. Likewise if you are struggling with debt, you should find out the truth about bankruptcy by meeting with an experienced bankruptcy attorney. If you find that you do need to file bankruptcy you should hire a competent and experienced bankruptcy attorney to help you file for bankruptcy.