Blackheads form when the open pores of your skin fill up with sebum, which turns black when exposed to air. Make sure that you are cleansing your face properly. Get the dirt and oil off your face before you got to bed at night.
Here is a homemade herbal paste for blackheads and whiteheads by Dr khurram:
Take a fresh and clean fenugreek leaves. Make its paste in grinder by adding little water in it. Apply it on face every night for 10-15 minutes every night and wash your face with warm water. Apply it at least for 20 days