Yes you can get into trouble for writing bad checks.
If it was just a bad check that you wrote by accident and it's not a reoccurring thing then you'll likely not face any jail time but could have to pay a fine and it would most likely be a misdemeanor depending on the state.
If the check is over $500.00 and it happens to often such as 3 checks in one month or really close together then it could be seen as a felony as they may believe you wrote them intentionally and that could land you in jail for 1 year and maybe even in prison for up to 5 years.
Always check your checking account and balance your checkbooks properly to be sure you have enough money in your checking account to cover the written check to avoid any trouble.
Because eventually it can land you in jail or even prison and it's so not worth it.