Ask for an activation code in a public thread and someone will usually supply a long string of digits. It will not work, and understanding why saves a lot of wasted attempts.
A key is checked against a database held by the publisher or storefront. It has to be unused, match the product and region, and correspond to a real purchase. A random sequence fails all three conditions, so no amount of retyping helps.
For a physical copy, it is printed on the case, manual or a sticker. For a digital one, it sits in the confirmation email and the library of the store that sold it. Those are the only two places a genuine key exists.
Contact the seller with proof of purchase. Grey-market key resellers are the least reliable option, since keys bought there are frequently already redeemed, region-locked, or revoked after the fact when the original payment is charged back.
A key posted in a forum is a key someone else can claim. Store yours somewhere durable and out of public view, and treat any request to share it as the licence violation it is.