There are lots of ways to do this, and choosing a proper course will depend on what kind of behavior you want to have, and how your game is set up.
Do you want the boomerang to always return to the player no matter where they are on the screen? I.E. if the player throws the boomerang and then jumps up to a higher platform, does the boomerang turn to return to the player, or does it just go back and forth in a straight line?
If the player “misses” catching it, does the boomerang continue in a straight line off screen, does it fly back and forth? Does it do a few loops and then disappear, or then fly off screen?
Does the boomerang fly at a constant speed, or does it slow down at the end of its arc? Does it return at the same speed?
Does the boomerang fly for a certain distance and then return, or does it fly for a certain amount of time?
Will there be different boomerangs that have different flight speeds/times? Different return behavior?
All these depend on the design of your game, there is no “right” or “wrong”; but once decided they can change the “right” and “wrong” ways to implement.
If you can provide more detail on the behavior you want to create, you’ll probably get more and better advice on how.