I don't lock my luggage, but some people do. If you choose to, note that the TSA can open any luggage they choose; if they can't open the lock, they'll cut it off. There are TSA-approved locks to which they have master keys and so should be able to unlock and relock your bag. You could also use zip-ties or twist-ties - at least if those are cut, you're out very little money. Also note that if someone wants to get into your luggage, a lock won't keep them out. Just don't check anything you can't live without - jewelry (really, leave it home), electronics, prescriptions should all go in carry-on luggage.
Yes, you can remove items from your carry-on aboard the plane. Once at your seat, step out of the aisle, put your luggage on a seat temporarily, remove the items you expect to use, and then stow your luggage - larger bag in the overhead compartment wheels-in or wheels-out, and personal item fully under the seat in front of you.