An optically trapped Brownian particle is a sensitive probe of molecular and nanoscopic forces. An understanding of its motion, which is caused by the interplay of random and deterministic contributions, can lead to greater physical insight into the behavior of stochastic phenomena. The modeling of realistic stochastic processes typically requires advanced mathematical tools. We discuss a finite difference algorithm to compute the motion of an optically trapped particle and the numerical treatment of the white noise term. We then treat the transition from the ballistic to the diffusive regime due to the presence of inertial effects on short time scales and examine the effect of an optical trap on the motion of the particle. We also outline how to use simulations of optically trapped Brownian particles to gain understanding of nanoscale force and torque measurements, and of more complex phenomena, such as Kramers transitions, stochastic resonant damping, and stochastic resonance.