Morning Joseph
Welcome to the Forum
If buy a Scanner make sure you get a BMW capable one a General scanner will see the major control units. A BMW capable one will give much clearer information
Your issue could be plugs, Coil Packs, a vacuum leak, air leaks on the inlet, clogged fuel filter (often forgotten at service)
A good service is the place to start
Good Luck
Dave