The grammar is correct.
Without more context, I cannot tell you if this expresses what you want to say, but the grammar is right.
Some examples:
"I need to adapt myself to my new working environment."
or
"The octopus will adapt itself to whatever objects and colors surround it."
Good luck!
Удачи!