When someone asks, "What do you need?" after you knock on a bathroom door, you can respond with a brief and polite reply to convey your purpose:
"Just checking if it's occupied.": This is a simple response to let them know you were just checking if the bathroom is currently in use.
"I need to use the bathroom, please.": If the bathroom is vacant, you can inform them that you need to use it.
"I'm waiting for my turn.": If the bathroom is occupied, you can let them know that you are waiting for your turn to use it.
It's always best to be respectful and brief in your response, as the person inside may be occupied or in a hurry to finish their business. If they indicate that they'll be done soon, it's courteous to wait patiently outside the door until they come out.