A simple joke formula is:
setup (topic), information and attitude about the topic, punch line.
Here's some things I think about when writing such a joke.
First thing you need is passion. Writing is fueled by passion. Pick only the topics that grab you, SERIOUSLY grabs you.
Investigate your topic. The more you know about it the more there is to write about or at least gain ideas.
When you first start thinking about a topic you feel a need to talk about in your act you are looking for ideas or funny images, not necessarily to begin writing.