Macbeth (a.k.a. Mac Bethad mac Findlàech) lived from 1005 to 15 August 1057 and was King of Alba from 15 August 1040 to 15 August 1057. The wider picture in Scotland at the time is set out in our Historical Timeline.
Macbeth was the maternal grandson of Malcolm II, and son of Findlàech, the sub-king of Moray. Macbeth had succeeded his cousin (on his father's side) Gillecomgain to become sub-king of Moray in 1031. At the same time he married Gillecomgain's widow, Princess Gruoch, and became step-father to her son by Gillecomgain, Lulach. His marriage was significant because Princess Gruoch was the grand-daughter of Kenneth III, and Lulach was the one possible competitor from that side of the House of Alpin not wiped out by Macbeth's own grandfather, Malcolm II.
It's fair to say that history has given Macbeth a bad press, largely because of the play named after him by William Shakespeare, whose plot bears little resemblence to real events: he was also never either Thane of Cawdor or Thane of Glamis. What did happen was that Macbeth sought to challenge his cousin Duncan's hold on the Scottish Crown, and by 1040 had formed an alliance with a mutual cousin, Earl Thorfinn of Orkney. The three met in battle near Elgin on 15 August 1040 and Duncan was killed.
Macbeth was a considerably better king than his predecessor. Under his rule Scotland became relatively stable and prosperous (from a very low base on both counts): so stable, indeed, that he was able to leave the country for a number of months while he made a pilgrimage to Rome.
In 1054, Duncan I's son, Malcolm Canmore, challenged for the throne of Scotland in alliance with Siward, Earl of Northumbria (who also happened to be Duncan's wife's cousin) and they took control of much of southern Scotland. On 15 August 1057 Macbeth's army was defeated at the Battle of Lumphanan, in Aberdeenshire, and Macbeth was killed. He was later buried in the graveyard at Saint Oran's Chapel on the Isle of Iona, the last of many Kings of Alba and Dalriada to be laid to rest there.
Macbeth was succeded to the Scottish Crown by his step-son Lulach, whose claim was based on having Kenneth III as his maternal great-grandfather. As an aside, there are those who have suggested that Macbeth and Earl Thorfinn of Orkney are actually one and the same person, simply seen through different traditions and legends.