Primary and secondary pupils in England will learn about relationships, keeping safe online and looking after their mental health as part of compulsory lessons from September next year.
Children in primary schools will have relationships education and this will be broadened to relationships and sex education in secondary schools.
Health education for all ages will also be part of the curriculum in England.
Parents will still have the right to withdraw their child up to age 15.
However, head teachers are expected to talk to parents who wish to exclude their child from these lessons, "discussing with the parents the benefits of receiving this important education and any detrimental effects that withdrawal might have on the child".
What issues will be covered in primary school?
Under new compulsory health education lessons, primary children will be taught about how to look after their own mental wellbeing and also to recognise when their classmates might be struggling.
They will cover why simple self-care, such as getting enough sleep and spending time outdoors and with friends, is important.
Teaching about the excessive use of electronic devices and limiting time spent online is also included.
In terms of relationships education, primary children will also be taught age-appropriate online safety - including what to do if they come across things they are uncomfortable with, the importance of respect for others even when posting anonymously and the risks of talking to people on the internet who they don't know in real life.
What will be covered in secondary school?
Secondary-age pupils will also have health education, focusing on mental health.
The curriculum will aim to ensure that young people can spot the signs of common mental illnesses, such as anxiety and depression in themselves or others.
They will learn how to discuss their emotions accurately and sensitively and how to access professional help.
They will also cover the impact of alcohol and drugs on physical and mental health.
In terms of sex and relationships, lessons will cover online safety topics, including the serious risks of sharing private photos, the impact of viewing explicit or harmful content - including how to report it and receive support.
Lessons will cover how the internet can promote an unhealthy view of sex and relationships.
The guidance says that pupils need to understand "that some people are LGBT [lesbian, gay, bisexual and transgender], that this should be respected in British society, and that the law affords them and their relationships recognition and protections".
The guidance adds: "Schools should make decisions about what it is appropriate to teach on this subject and when, based on the age, development and religious backgrounds of their pupils, and should involve their parents in these decisions."
Secondary-age pupils will also be taught about female genital mutilation (FGM) - focusing on awareness, the availability of support networks and reminding them that it is illegal.
The government says they should also be taught about other forms of honour-based abuse, as well as grooming, forced marriage and domestic abuse.
Schools will decide how frequently to hold age-appropriate lessons.
The new guidance follows an extensive call for evidence and a three-month consultation, which received more than 11,000 responses.
Will there be controversy over this?
There are certainly groups who have concerns about what issues are covered in RSE and who feel some topics should not be taught by schools.
The Parent Power advice website says parents should be able to educate children in line with their own religious faith.
Linda Rose, from the group, says she is not convinced by promises that teaching will be age appropriate.
"Children are given too much information too young and don't have the emotional maturity to process all this information," she says.
"We are worried that this isn't upholding religion as a protected characteristic with equal value to the other protected characteristics."
Recently, a group of Muslim parents in Birmingham protested over their children being taught about LGBT rights and homophobia.
Also, a petition calling for parents to have the right to opt their child out of sex education lessons has attracted more than 106,000 signatures.
It says: "We believe it is the parent's fundamental right to teach their child RSE topics or to at least decide who teaches them and when and how they are taught.
"We want the right to opt our children out of RSE when it becomes mandatory in Sept 2020.
"We have grave concerns about the physical, psychological and spiritual implications of teaching children about certain sexual and relational concepts proposed in RSE and believe that they have no place within a mandatory school curriculum."
What does the education secretary say?
Speaking in the House of Commons on Monday, Education Secretary Damian Hinds said £6m would be made available in 2019/20 to cover training and resources.
Mr Hinds said: "Growing up and adolescence are hard enough, but the internet and social media add new pressures that just weren't there even one generation ago.
"Almost 20 years on from the last time guidance on sex education was updated, there is a lot to catch up on."
Mr Hinds adds that it is "appropriate" to make health education universal alongside relationships and sex education.
"It will help children learn how to look after themselves, physically and mentally, and the importance of getting away from the screen and the headphones.
"And it can help young people be resilient as they chart a course through an ever more complex world."
How have charities responded?
Charities have been generally positive about the government's new guidelines.
The NSPCC said the guidance would help children "navigate the modern world".
Head of policy, Almudena Lara, said: "The NSPCC firmly believes that every child should be taught from an early age about consent, different relationships, and what abuse and harassment is, so that they learn they have the right to be treated with dignity and respect.
"Teachers must receive high-quality training and support to deliver the new curriculum, so that every school across the country meets the same high standards."
The Catholic Education Service said it welcomed the government's announcement.
Director Paul Barber said: "Catholic education is centred on the formation of the whole child and age-appropriate RSE is an essential part of this.
"It is essential for creating well-rounded young people, for equipping students to make good life choices and for keeping our children safe."
Anna Feuchtwang, chief executive of campaign group the National Children's Bureau, said the guidance was "a welcome step forward in preparing children for adulthood, improving their well-being and keeping them safe and healthy".
What were your experiences of sexual education in school? Could it have been improved? Email email@example.com.
Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways: