You can attach/detach security group without stopping your instance.
Select your instance
Actions->Networking->Change Security groups.
Now, you can attach /detach whatever the security group you needed.
Want to Learn AWS, check out AWS Course by Intellipaat.