The advent of quantum devices, which exploit the two essential elements of quantum physics, coherence and entanglement, has sparked renewed interest in the control of open quantum systems. Successful implementations face the challenge to preserve the relevant nonclassical features at the level of device operation. A major obstacle is decoherence which is caused by interaction with the environment. Optimal control theory is a tool that can be used to identify control strategies in the presence of decoherence. We review here recent advances in optimal control methodology that allow for tackling typical tasks in device operation for open quantum systems and discuss examples of relaxation-optimized dynamics. Optimal control theory is also a useful tool to exploit the environment for control. We discuss examples and point out possible future extensions.