ode2 = D[x[t],{t,2}] ==(1-x[t])/(2 + Sin[t])

DSolve[ode2,x[t],t]

nsol =NDSolve[{ode2,x[0]==0,x'[0]==1},x[t],{t,0,100}]

Plot[x[t]/.nsol,{t,0,50}]