What time do food places stay open to? Hello!

The flight we're probably getting will land after 9pm. Will there still be places open to eat at or should I have a meal before I start the trip?

Thanks, and I can't wait to explore Madrid!