Stochastic Optimization and Learning: An Adaptive and Resource-Efficient Approach