Whether or not you accept the job depends on whether you think the terms are acceptable. Find out what terms they are offering. As @fredsbend says in his comment, are they asking you to sell all rights, i.e. "work done for hire", they would own the copyright, or are they asking for a license to use your work but you would still own the copyright?
I have no idea how valuable your work is to you or what they are offering. If you're just starting out and you're doing the work in your spare time, maybe $20 and the fun of seeing your work in print would be worth it. If you do this for a living, maybe you need thousands for it to be worth your time.
Of course it's better for you if you keep the copyright and just sell them permission to use it. If they insist on owning the copyright, how big a deal is this to you? Do you think you could sell the same illustrations elsewhere? Do you think they will likely use the same illustrations in another book? Etc. If someone offered, say, $1000 for the right to use your pictures in one book, or $2000 to buy all rights so they can use them all they want, which would you prefer? I'd never say, "No, I will not sell my copyright, period." What if they offered a million dollars? Or more realistically, what if they said, "Hey, if this book works out, we have many other books that we'd like you to do illustrations for." Getting your foot in the door is often worth the trouble of a small first job. Etc.