If you want to keep the inheritance in full it’s important to wait for at least 180 days before filing your bankruptcy.
If you receive an inheritance within 180 of filing your case, that money will become part of the bankruptcy estate, which means that the Trustee can take it to pay your creditors. The clock starts as soon as you are entitled to receive the inheritance, usually when the benefactor passes away.
You can try to protect an inheritance by claiming an exemption (or amending the schedules in your existing case), but you will only be able to protect up to a certain amount. If the inheritance is likely to exceed the amount you can exempt (or protect), you should wait to file.