are you on a flat surface? Get over onto your bum allowing your knee to remain bent. You want to get the weight and the pressure off the bent knee. Then just wait and it will unlock. Are you alone?
Possibly a torn cartilage. (It's surprisingly easy to do). If you can get hold of someone to take you to hospital then, obviously, do so. Otherwise you'll have to call an ambulance. (If you can't get to the door to let them in, think about who might have a key to your house, such as a neighbour and friend, and contact them too).