The best jokes all come down to timing and choosing your audience. As a result, there is no simple way of knowing if your material is funny without testing it in front of many different people. What may be funny to one person could be offensive to another.
Many of the best comedians spend a great deal of time rehearsing their material in front of many different audiences. From this testing, they learn what the majority of audiences find humorous and continue using that material in future shows. Because of the subjective nature of humor, being a good comedian takes more work than most people would think, writes ComicWonder.com