Most oven elements have a mounting plate that attaches to the oven cavity interior at the rear. That mounting plate is usually held in place by 2 screws which go through it into the rear oven liner.
In the case of a broil element, there may also be 1-2 additional screws mounted vertically into the ceiling of the oven cavity towards the front. The screws may go through a bracket attached to the element itself or the mounting bracket may be a separate part.
Once power has been disconnected from the appliance (do NOT just rely on the controls being off!), the element mounting screws can be attempted to be removed. The mounting screws can sometimes be rusted or seized in place so make sure a good screwdriver is used so the screw heads won't get stripped.
Once the retaining screws have all been removed, the element can often be pulled (at least slightly) into the oven cavity. Don't pull too hard as push-on wire connectors (if used) can 'pop off' allowing a wire to get lost in the oven insulation and requiring the job to be completed the hard way (see below).
If the manufacturer was feeling generous during the manufacturing process, you may actually have enough wire to pull the element somewhat into the oven cavity to work more comfortably on it. If not enough slack wire is available, it may be difficult to undo the wires from inside the oven. In such a case, the rear panel of a range may need to be removed (or an oven removed from the wall) in order to access the power wires.
Tip: Most oven doors are removable. Check your owner's manual to see if it is a possibility as doing so can make working inside the oven a bit easier, but it is not absolutely necessary.
The wiring for oven elements will usually just push onto terminals on the element ends using common (although high temperature) stake-on connectors. Some oven elements though use screw terminals instead, which would require the wire retaining screws to be totally removed from the element to get the power wires off.
The hard way
If you can't access the element terminals from inside the oven, the back panel of a stove would usually need to be removed to get to them. On a built-in wall oven, the oven would need to be removed from its enclosure. Once you have access to the rear oven insulation, the wires going to the elements should be able to be followed to find the element terminals.
Replace your divots! Any insulation disturbed in the process should be corrected before the panel or oven is reinstalled.
Installing the element
When reconnecting the wiring on a common 2-wire element, it does not matter which wire goes to which element terminal as long as any ground wire which may be present goes back onto a ground terminal. Ground wires are not often found on oven elements any longer as the element is usually grounded when it is screwed securely to the oven cavity.
On elements with more than 2 wire terminals (rare), it WILL matter which wire goes where so either transfer one wire at a time from old to new and/or make a diagram of where they go to be safe. Two wires connected just to a single terminal on an element does not usually constitute one of these rare elements.
'Hidden' Bake Element
Many newer electric ovens are going to a hidden (unseen) bake element to make oven cleaning easier. (Aren't most newer ovens self-cleaning already?)
Getting to these hidden bake elements vary from manufacturer to manufacturer and could be as simple as going in from the rear, just lifting an oven bottom panel covering it or in some cases, as much as partially lifting the cooktop and removing the right or left hand side panel to gain access to it! Check for a service manual for your particular model if you want to attempt the job yourself.