How to rotate around the parent in 2D?

I want to make a game object rotate around its moving parent in a 2D game, but all examples and questions I’ve found are related to 3D.

Do you know how to achieve this? Is there any method to rotate around a given pivot point or specific game object while this is moving?

The way I’ve accomplished this in either 2D or 3D is to create an empty game object at the location of the parent. Do not parent the empty game object with the parent. Create a simple script that positions the new game object at the origin of the parent. It would be something like so:

 public transform Target;
    void Update() {
        gameObject.transform.position = Target.position;

After that, it should just be a matter of attaching your orbiting object to the empty game object you created. Now when you rotate your new game object, your orbiting object should rotate around the parent.