Lay the bookshelf down horizontally.
Place a piece of plywood on top of the bookshelf. Make sure that the corners of the plywood and the bookshelf are lined up together evenly, as you will be drilling two screws into each corner of the plywood and bookshelf.
Mark on the plywood where you will be drilling the screws. There will be two screws in each corner and the screws should be at least 1/2 inch from the edge of the plywood in order to attach the plywood securely to the bookshelf and prevent the wood from splitting.
Drill small holes into the plywood and bookshelf with a drill bit that is slightly smaller than the shank of the screws in the spots where you marked the plywood. These small holes will keep the wood from splitting when you drill the actual screws into the plywood and bookshelf.
Drill two screws into each corner of the plywood and bookshelf. Place your mattress on top of the plywood to complete your new bed.