When utilizing Azure Machine Learning to develop a custom model in a notebook, you face the challenge of configuring a compute instance via the terminal. Which actions are crucial to efficiently set up and optimize the compute instance for your project's needs?