Shallots have a milder, sweeter flavour than onions.
They can be used in pretty much the same way. They should be peeled before chopping and using as a base. They have finer layers and are a little more fiddly than an onion. They also contain less water, so need to be cooked over lower heat and watched more carefully.
They take minutes to fry and roast in under half an hour. Store them in a dry, dark place with good air circulation and they will be safe to keep for a few weeks. They are safe to eat even if they have dried up a little, but avoid any mouldy ones.