I have a second/third degree burn. It seems to be healing fine. But there are 2 small spots that has yellow stuff coming out. Is it infected?

Impossible to know. How big is the burn? Have you seen a medical professional for this? and if so what treatments were recommended and have they been followed. The assessment of all wounds for appropriate healing and evidence of infection is an imperfect science but is best done by an experienced provider who can see and touch the wound - even digital images are no substitute for an "analog" exam by the doctor.