Hard to tell what the problem fully is from just a pic.
Is the stem rotting?
Are the needle / leaf things rotting?
Is it just the flowers that are browning and shriveling up?
If its just the flowers pull the old flowers off - it's called deadheading. Read this link about it
60 seconds of internet search and reading told me this plant is from a tropical arid-ish place. It wants sandy dryer soil. Over watering it and keeping it moist will kill the thing quickly.
It’s the flowers shriveling up and the plant calls for full sun and when I do that it seems that the flowers burn off and die but when I bring it inside life comes back so I’m a little confused ask for proper care for Portulaca . But I will read the link you sent me thank you for your response
You answer your question actually. The problem may caused by sun. Or maybe they like moist places. So you can put your plant to place in your home that see the sun partially. Not too much but some sun will help your plant.