If it is just occasionally
popping with no pain, it could be nothing and some exercise like
knee bends could strengthen your
knee. On the other hand, it is painful too especially with swelling you may want to see a doc. If your knee is making a grinding noise for example it could mean that the cartilage is wearing down.
Especially if this continues to bother you check with your pcp or an orthopedic specialist before exercising or anything!