Sometimes my 4 month old doesn't stop crying until he is sucking on my breast for comfort and won't take the pacifier, what should I do?

Pacifier. This is a time that baby has nutritive sucking needs (actually feeding milk from the breast) and also non nutritive sucking needs (comfort sucking as you mention) Four month olds are able to start to SELF console which is important to let him start doing now. When you know he is full and starting to suck to console and sleepy, put him down sleepy but not asleep. He can learn to suck a thumb!