Thank you for your question – I fully empathise with you symptoms as it’s a very common. As Dr Alan has mentioned, there can be many causes for anterior (at the front) knee pain. Rather than go through the causes again, perhaps I could suggest a few simple things to try out when managing your symptoms.
Firstly, stretching; often, we tend to develop tight muscles in the front of our legs (commonly called quads and hip flexors) – when these are tight, it might be pulling he knee cap more tightly into the thigh bone. So a simple measure might be some stretching and you can find many different videos on YouTube – an example is: https://youtu.be/CZBKSOtyssM
Another option is seeing a physiotherapist who can give you some exercises to do to limit the mal-tracking that Dr Alan mentions. It might be that you have ITB tightness, or weakness in the quads (I know this sounds strange after mentioning about tight quads earlier) or hip muscles.
Finally, perhaps consider some activity modification – if you’re a runner and this brings on pain, offload a little and try other methods of keeping fit. This should only be temporary measure until the underlying problem is resolved.
Good luck with you symptoms and hope it clears up soon.