Flare up and knee lock

First time I've experienced knee lock, god it's painful, I actually thought I was going to be sick ,seem to take forever to unlock and now I feel exhausted and still in pain, how do people cope with knee lock with osteoarthritis and I'm not sure if I did anything to bring it on, it's unlocked now and I'm glued to sofa but it was scary luckily I was at home