OSHA 510 courses cannot be taken online, so there is no way to prepare for an online course of this nature. Details of courses in particular geographical areas can be found at OSHA.gov, along with details of the prerequisites for taking the course.
The OSHA 510 Occupational Safety and Health Standards for Construction course is offered only through authorized OSHA Training Institute Education Centers. These centers sometimes provide online materials to help registered students prepare for these courses. The type and quantity of these materials vary from institution to institution, so students should check out several different providers to see which they find the most helpful.