There are a couple of methods to get sesame seeds to stick to homemade bagels. After shaping the bagels and boiling them, they will have a slightly sticky surface. If you add the sesame seeds as soon as the bagel comes out of the boiling water they should adhere to the bagel. The second method is to use an egg wash. Boil the bagels and right before baking, gently brush them with an egg wash to help the sesame seeds stick to the surface of the bagels.