öffentlich
public
Accessible, visible, or usable for everyone; not private.
Dies ist ein öffentlicher Park, in dem jeder spazieren gehen darf.
This is a public park where everyone is allowed to go for a walk.

public
Loading your saved state.
public
Accessible, visible, or usable for everyone; not private.
Dies ist ein öffentlicher Park, in dem jeder spazieren gehen darf.
This is a public park where everyone is allowed to go for a walk.

'Öffentlich' (public/publicly) can stand before a noun as an adjective or function as an adverb that describes a verb. As an adjective, it is declined; as an adverb, it remains unchanged.
Das ist ein öffentlicher Garten.
That is a public garden.
In the meaning 'accessible to everyone', 'öffentlich' (public) is often found in fixed combinations such as 'öffentliche Verkehrsmittel' (public transportation: buses, trains), 'öffentliche Plätze' (public squares/places), or 'öffentliche Gebäude' (public buildings).
In der Stadt nutze ich meistens die öffentlichen Verkehrsmittel.
In the city, I mostly use public transportation.
When 'öffentlich' (public) refers to the state, it often appears with words such as 'der öffentliche Dienst' (public service / work for the state), 'öffentliche Gelder' (public funds / tax money), or 'die öffentliche Hand' (the public sector / the state as an institution).
Viele meiner Freunde arbeiten im öffentlichen Dienst.
Many of my friends work in the public service.
In the meaning 'in front of everyone', 'öffentlich' (publicly) is almost always used as an adverb. It then describes verbs of speaking or showing, e.g. 'öffentlich zugeben' (to publicly admit), 'öffentlich kritisieren' (to publicly criticize), or 'sich öffentlich zeigen' (to appear in public).
Der Star hat sich nach dem Skandal lange nicht öffentlich geäußert.
The star did not comment publicly for a long time after the scandal.
open
'offen' and 'öffentlich' can both mean that something is not intended only for a small private group. 'offen' emphasizes that everyone is allowed to take part or go in, so there is no strong restriction. 'öffentlich' emphasizes that something is visible, accessible, or not private. Learners can confuse the words, especially with events. An 'offener Kurs' (open course) means that you may take part without a special invitation. An 'öffentliche Diskussion' (public discussion) means that it takes place in front of other people or is intended for the public.

Lena hat ihre Meinung nicht öffentlich gesagt, sondern nur im Gespräch mit ihrer Freundin.
Lena did not state her opinion publicly, but only in a conversation with her friend.
Der Sportkurs ist offen für alle, die mitmachen möchten.
The sports course is open to everyone who wants to join in.