as an adjective, 'only' is used to describe a noun as being solitary or singular in number or kind.
'Only' can be used to indicate that there is just one of something.
She is the only person I trust.
The only car in the lot was mine.
He's the only candidate who can make a difference.
When used as an adjective, 'only' often emphasizes the uniqueness or exclusivity of the noun it modifies.
as an adverb, 'only' is used to modify a verb, an adjective, or another adverb, often indicating limitation or restriction.
'Only' can be used to show that an action is limited to specific conditions or circumstances.
She only speaks on weekends.
I only eat vegetarian food.
He arrived only five minutes late.
The placement of 'only' can change the meaning of a sentence. For example, 'I only ate the cake' suggests you didn't do anything else with the cake, while 'I ate only the cake' suggests you didn't eat anything else.
as a conjunction, 'only' is used to introduce a clause that presents the sole exception to a previous statement.
'Only' can be used to introduce a clause that specifies the only condition under which a statement is true.
I would go, only I have another commitment.
She would have succeeded, only she didn't try hard enough.
When used as a conjunction, 'only' often introduces a sense of regret or missed opportunity.