If you have an old log or fallen tree that beetles have chewed holes in, you already have a pre-made home for wood nesters. Drill a variety of 3/32” to 5/16” holes along the south facing side as deep as you can. However lacking an old 4 foot log, simply get a piece of wood. No, not treated wood. And as you are going erect it like a fence post, angle the drill holes upward so when it rains the bees home is safe and dry.
Another way to provide bee residences is to plant raspberry, blackberry or elderberry bushes, dogwood or boxelder as these have pithy stems. Each spring cut back new growth here and there so the interior of the stems are available for the wood.
Carpenter bees will leave your house alone if given a nice old dead tree. If you are fortunate enough to have a wooded area, leave that old felled tree and let them find homes in it.
For information on Blue Orchard Bees, and how to build a house for them, visit www.ces.ncsu.edu/.../Other/note109/note109.html . They have a nice design that is both attractive and functional.