1) Fit. Saddle height and cleat float too much or little. Fore/aft movement of the saddle could be looked at too.
2) Bike. Brakes save knees and spinning is easier on them too.
3) Shoes. Soft soles can be bad, so can a bad cleat position on cycling shoes.
4) Let your knees heal. Take some time off the bike if youve been on it more.