Many of the auto parts retailers do have car remotes and keys to sell. They come with instructions as long as the vehicle is on board programmable. Some stores will help you with that programming.
There are only a few vehicle are on board programmable, a majority of remotes have to be done by a dealership or a certified locksmith using a tool that communicates with the vehicles system to accept a new remote.
At the dealership, remotes and keys would generally cost more quite often twice as much as what the locksmith would charge. The Locksmith will also cost you less time with no hidden or additional fees and handles both the remotes and the keys involved with starting and securing your vehicle.
If there are any tricks or difficulties that each vehicle can present, locksmiths will be able to address them quicker than a dealer.